Skip to content

Commit 500279f

Browse files
committed
[YouTube] support extracting DRC audio
Implements support for checking whether an extracted audio format is using dynamic range compression (DRC).
1 parent fba182c commit 500279f

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/ItagItem.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,15 @@ public MediaFormat getMediaFormat() {
266266
private AudioTrackType audioTrackType;
267267
@Nullable
268268
private Locale audioLocale;
269+
private boolean isDrc;
270+
271+
public Boolean isDrc() {
272+
return isDrc;
273+
}
274+
275+
public void setIsDrc(final Boolean isDrc) {
276+
this.isDrc = isDrc;
277+
}
269278

270279
public int getBitrate() {
271280
return bitrate;

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@ private ItagInfo buildAndAddItagInfoToList(
14211421
itagItem.setIndexEnd(Integer.parseInt(indexRange.getString("end", "-1")));
14221422
itagItem.setQuality(formatData.getString("quality"));
14231423
itagItem.setCodec(codec);
1424+
itagItem.setIsDrc(formatData.getBoolean("isDrc", false));
14241425

14251426
if (streamType == StreamType.LIVE_STREAM || streamType == StreamType.POST_LIVE_STREAM) {
14261427
itagItem.setTargetDurationSec(formatData.getInt("targetDurationSec"));

0 commit comments

Comments
 (0)