From a719b7df53a4c2e170bbb099ad40826b6f212194 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 7 Jan 2024 00:45:57 +0100 Subject: [PATCH] AudioStream: remove unused youtube-specific fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These fields were added in https://github.com/TeamNewPipe/NewPipeExtractor/pull/810 in preparation for a DASH support that never materialized … well it did materialize, but did not use any of these variables. Since they are youtube-specific, it does not make much sense to export them in the generic API, lest people start depending on them as if they belonged to all backends. Well, 4 variables are actually already depended on in places, they will have to be checked separately. But this is the low-hanging fruit. --- .../newpipe/extractor/stream/AudioStream.java | 97 +------------------ 1 file changed, 1 insertion(+), 96 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java index e31e1aff35..20924819c6 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java @@ -33,13 +33,7 @@ public final class AudioStream extends Stream { private final int averageBitrate; - // Fields for DASH - private int itag = ITAG_NOT_AVAILABLE_OR_NOT_APPLICABLE; - private int bitrate; - private int initStart; - private int initEnd; - private int indexStart; - private int indexEnd; + // Fields specific to the Youtube backend private String quality; private String codec; @@ -348,14 +342,7 @@ private AudioStream(@Nonnull final String id, @Nullable final ItagItem itagItem) { super(id, content, isUrl, format, deliveryMethod, manifestUrl); if (itagItem != null) { - this.itagItem = itagItem; - this.itag = itagItem.id; this.quality = itagItem.getQuality(); - this.bitrate = itagItem.getBitrate(); - this.initStart = itagItem.getInitStart(); - this.initEnd = itagItem.getInitEnd(); - this.indexStart = itagItem.getIndexStart(); - this.indexEnd = itagItem.getIndexEnd(); this.codec = itagItem.getCodec(); } this.averageBitrate = averageBitrate; @@ -386,88 +373,6 @@ public int getAverageBitrate() { return averageBitrate; } - /** - * Get the itag identifier of the stream. - * - *

- * Always equals to {@link #ITAG_NOT_AVAILABLE_OR_NOT_APPLICABLE} for other streams than the - * ones of the YouTube service. - *

- * - * @return the number of the {@link ItagItem} passed in the constructor of the audio stream. - */ - public int getItag() { - return itag; - } - - /** - * Get the bitrate of the stream. - * - * @return the bitrate set from the {@link ItagItem} passed in the constructor of the stream. - */ - public int getBitrate() { - return bitrate; - } - - /** - * Get the initialization start of the stream. - * - * @return the initialization start value set from the {@link ItagItem} passed in the - * constructor of the stream. - */ - public int getInitStart() { - return initStart; - } - - /** - * Get the initialization end of the stream. - * - * @return the initialization end value set from the {@link ItagItem} passed in the constructor - * of the stream. - */ - public int getInitEnd() { - return initEnd; - } - - /** - * Get the index start of the stream. - * - * @return the index start value set from the {@link ItagItem} passed in the constructor of the - * stream. - */ - public int getIndexStart() { - return indexStart; - } - - /** - * Get the index end of the stream. - * - * @return the index end value set from the {@link ItagItem} passed in the constructor of the - * stream. - */ - public int getIndexEnd() { - return indexEnd; - } - - /** - * Get the quality of the stream. - * - * @return the quality label set from the {@link ItagItem} passed in the constructor of the - * stream. - */ - public String getQuality() { - return quality; - } - - /** - * Get the codec of the stream. - * - * @return the codec set from the {@link ItagItem} passed in the constructor of the stream. - */ - public String getCodec() { - return codec; - } - /** * Get the id of the audio track. *