From 7d27f8f25d0585501b1369399c3c3fc4ba78ee6f Mon Sep 17 00:00:00 2001 From: AudricV <74829229+AudricV@users.noreply.github.com> Date: Sat, 11 Mar 2023 21:53:07 +0100 Subject: [PATCH] [YouTube] Fix descriptive audio role property value in generated DASH manifests The note 2 of the section 5.8.5.5 of ISO/IEC 23009-1 specifies that when using the alternate role value, a description of what the alternate track is should be added. As alternate is a generic role and a description role exists, it should be used instead of the alternate one. The property value has been of course updated in the corresponding test. --- .../YoutubeDashManifestCreatorsUtils.java | 4 ++-- .../services/youtube/YoutubeDashManifestCreatorsTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreators/YoutubeDashManifestCreatorsUtils.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreators/YoutubeDashManifestCreatorsUtils.java index 418264df0..abeb2f4e8 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreators/YoutubeDashManifestCreatorsUtils.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/dashmanifestcreators/YoutubeDashManifestCreatorsUtils.java @@ -278,7 +278,7 @@ public final class YoutubeDashManifestCreatorsUtils { * *

* {@code }, where {@code VALUE} is - * {@code main} for videos and audios and {@code alternate} for descriptive audio + * {@code main} for videos and audios and {@code description} for descriptive audio *

* *

@@ -299,7 +299,7 @@ public final class YoutubeDashManifestCreatorsUtils { setAttribute(roleElement, doc, "schemeIdUri", "urn:mpeg:DASH:role:2011"); setAttribute(roleElement, doc, "value", itagItem.isDescriptiveAudio() - ? "alternate" : "main"); + ? "description" : "main"); adaptationSetElement.appendChild(roleElement); } catch (final DOMException e) { diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeDashManifestCreatorsTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeDashManifestCreatorsTest.java index 13810bdc7..d5e9c15a5 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeDashManifestCreatorsTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeDashManifestCreatorsTest.java @@ -233,7 +233,7 @@ class YoutubeDashManifestCreatorsTest { private void assertRoleElement(@Nonnull final Document document, @Nonnull final ItagItem itagItem) { final Element element = assertGetElement(document, ROLE, ADAPTATION_SET); - assertAttrEquals(itagItem.isDescriptiveAudio() ? "alternate" : "main", element, "value"); + assertAttrEquals(itagItem.isDescriptiveAudio() ? "description" : "main", element, "value"); } private void assertRepresentationElement(@Nonnull final Document document,