Skip to content

Commit c0f1777

Browse files
committed
Removed unused equalsStream
1 parent 665ee1e commit c0f1777

File tree

6 files changed

+2
-69
lines changed

6 files changed

+2
-69
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/streamdata/stream/AudioStream.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,9 @@
22

33
import org.schabi.newpipe.extractor.streamdata.format.AudioMediaFormat;
44

5-
import java.util.Objects;
6-
7-
import javax.annotation.Nullable;
8-
95
/**
106
* Represents a audio (only) stream.
117
*/
128
public interface AudioStream extends Stream<AudioMediaFormat>, BaseAudioStream {
13-
14-
@Override
15-
default boolean equalsStream(@Nullable final Stream other) {
16-
if (!(other instanceof AudioStream)) {
17-
return false;
18-
}
19-
20-
final AudioStream otherAudioStream = (AudioStream) other;
21-
return Objects.equals(mediaFormat(), otherAudioStream.mediaFormat())
22-
&& averageBitrate() == otherAudioStream.averageBitrate();
23-
}
9+
// Nothing
2410
}
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.schabi.newpipe.extractor.streamdata.stream;
22

3-
import javax.annotation.Nullable;
4-
53
public interface BaseAudioStream {
64
int UNKNOWN_AVG_BITRATE = -1;
75

@@ -13,13 +11,4 @@ public interface BaseAudioStream {
1311
default int averageBitrate() {
1412
return UNKNOWN_AVG_BITRATE;
1513
}
16-
17-
default boolean equalsStream(@Nullable final Stream other) {
18-
if (!(other instanceof BaseAudioStream)) {
19-
return false;
20-
}
21-
22-
final BaseAudioStream otherAudioStream = (BaseAudioStream) other;
23-
return averageBitrate() == otherAudioStream.averageBitrate();
24-
}
2514
}

extractor/src/main/java/org/schabi/newpipe/extractor/streamdata/stream/Stream.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.schabi.newpipe.extractor.streamdata.format.MediaFormat;
55

66
import javax.annotation.Nonnull;
7-
import javax.annotation.Nullable;
87

98
public interface Stream<M extends MediaFormat> {
109

@@ -18,8 +17,4 @@ public interface Stream<M extends MediaFormat> {
1817

1918
@Nonnull
2019
DeliveryData deliveryData();
21-
22-
23-
// TODO: May also have to check deliverydata
24-
boolean equalsStream(@Nullable Stream other);
2520
}

extractor/src/main/java/org/schabi/newpipe/extractor/streamdata/stream/SubtitleStream.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
import org.schabi.newpipe.extractor.streamdata.format.SubtitleMediaFormat;
44

55
import java.util.Locale;
6-
import java.util.Objects;
76

87
import javax.annotation.Nonnull;
9-
import javax.annotation.Nullable;
108

119
/**
1210
* Represents a subtitle (only) stream.
@@ -42,16 +40,4 @@ default boolean autoGenerated() {
4240
* @return the {@link Locale locale} of the subtitles
4341
*/
4442
Locale locale();
45-
46-
@Override
47-
default boolean equalsStream(@Nullable final Stream other) {
48-
if (!(other instanceof SubtitleStream)) {
49-
return false;
50-
}
51-
52-
final SubtitleStream otherSubtitleStream = (SubtitleStream) other;
53-
return Objects.equals(mediaFormat(), otherSubtitleStream.mediaFormat())
54-
&& autoGenerated() == otherSubtitleStream.autoGenerated()
55-
&& Objects.equals(languageCode(), otherSubtitleStream.languageCode());
56-
}
5743
}
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
package org.schabi.newpipe.extractor.streamdata.stream;
22

3-
import javax.annotation.Nullable;
4-
53
/**
64
* Represents a combined video+audio stream.
75
*/
86
public interface VideoAudioStream extends VideoStream, BaseAudioStream {
9-
@Override
10-
default boolean equalsStream(@Nullable final Stream other) {
11-
if (!(other instanceof VideoAudioStream)) {
12-
return false;
13-
}
14-
15-
return VideoStream.super.equalsStream(other) && BaseAudioStream.super.equalsStream(other);
16-
}
7+
// Nothing
178
}

extractor/src/main/java/org/schabi/newpipe/extractor/streamdata/stream/VideoStream.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,12 @@
33
import org.schabi.newpipe.extractor.streamdata.format.VideoAudioMediaFormat;
44
import org.schabi.newpipe.extractor.streamdata.stream.quality.VideoQualityData;
55

6-
import java.util.Objects;
7-
86
import javax.annotation.Nonnull;
9-
import javax.annotation.Nullable;
107

118
/**
129
* Represents a video (only) stream.
1310
*/
1411
public interface VideoStream extends Stream<VideoAudioMediaFormat> {
1512
@Nonnull
1613
VideoQualityData videoQualityData();
17-
18-
@Override
19-
default boolean equalsStream(@Nullable final Stream other) {
20-
if (!(other instanceof VideoStream)) {
21-
return false;
22-
}
23-
24-
final VideoStream otherVideoStream = (VideoStream) other;
25-
return Objects.equals(mediaFormat(), otherVideoStream.mediaFormat())
26-
&& videoQualityData().equalsVideoQualityData(otherVideoStream.videoQualityData());
27-
}
2814
}

0 commit comments

Comments
 (0)