summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2022-07-11 17:24:03 +0200
committerSamantaz Fox <coding@samantaz.fr>2022-07-11 17:29:42 +0200
commit69ad57338f38662fb0a4d22aa58bec8dc7a5742c (patch)
tree2042b7a66c4e360d85bcf1e6e46826c948a3eea3 /src
parentcbcf31a4f98706ea675cafb7509b37dc2b0ceace (diff)
downloadinvidious-69ad57338f38662fb0a4d22aa58bec8dc7a5742c.tar.gz
invidious-69ad57338f38662fb0a4d22aa58bec8dc7a5742c.tar.bz2
invidious-69ad57338f38662fb0a4d22aa58bec8dc7a5742c.zip
Mention why we use multiple AdaptationSet for audio
Diffstat (limited to 'src')
-rw-r--r--src/invidious/routes/api/manifest.cr4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/invidious/routes/api/manifest.cr b/src/invidious/routes/api/manifest.cr
index 52b94175..a857d18f 100644
--- a/src/invidious/routes/api/manifest.cr
+++ b/src/invidious/routes/api/manifest.cr
@@ -64,6 +64,10 @@ module Invidious::Routes::API::Manifest
# OTF streams aren't supported yet (See https://github.com/TeamNewPipe/NewPipe/issues/2415)
next if !(fmt.has_key?("indexRange") && fmt.has_key?("initRange"))
+ # Different representations of the same audio should be groupped into one AdaptationSet.
+ # However, most players don't support auto quality switching, so we have to trick them
+ # into providing a quality selector.
+ # See https://github.com/iv-org/invidious/issues/3074 for more details.
xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, label: fmt["bitrate"].to_s + "k") do
codecs = fmt["mimeType"].as_s.split("codecs=")[1].strip('"')
bandwidth = fmt["bitrate"].as_i