[vlc-commits] demux: hls: prefer average bandwidth when available

Francois Cartegnie git at videolan.org
Wed Feb 10 12:27:53 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Feb  9 21:09:50 2021 +0100| [f9b0cad3896c0276d467c5ad3be104baf946acdf] | committer: Francois Cartegnie

demux: hls: prefer average bandwidth when available

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f9b0cad3896c0276d467c5ad3be104baf946acdf
---

 modules/demux/hls/playlist/Parser.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 4ac76cbda3..8001b4e9fe 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -91,7 +91,9 @@ static void releaseTagsList(std::list<Tag *> &list)
 HLSRepresentation * M3U8Parser::createRepresentation(BaseAdaptationSet *adaptSet, const AttributesTag * tag)
 {
     const Attribute *uriAttr = tag->getAttributeByName("URI");
-    const Attribute *bwAttr = tag->getAttributeByName("BANDWIDTH");
+    const Attribute *bwAttr = tag->getAttributeByName("AVERAGE-BANDWIDTH");
+    if(!bwAttr)
+        bwAttr = tag->getAttributeByName("BANDWIDTH");
     const Attribute *resAttr = tag->getAttributeByName("RESOLUTION");
 
     HLSRepresentation *rep = new (std::nothrow) HLSRepresentation(adaptSet);



More information about the vlc-commits mailing list