[vlc-commits] demux: hls: declare some codecs for alternative streams

Francois Cartegnie git at videolan.org
Mon May 20 16:58:06 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 15 12:14:24 2019 +0200| [73b0511eb8e897d66eed2a5350640ac6639d1fca] | committer: Francois Cartegnie

demux: hls: declare some codecs for alternative streams

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

 modules/demux/hls/playlist/Parser.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 1e069250b7..84a1cace63 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -493,7 +493,18 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
                 }
 
                 if(pair.second->getAttributeByName("CODECS"))
+                {
                     rep->addCodecs(pair.second->getAttributeByName("CODECS")->quotedString());
+                }
+                else
+                {
+                    if(pair.second->getAttributeByName("TYPE")->value == "AUDIO")
+                        rep->addCodecs("mp4a");
+                    else if(pair.second->getAttributeByName("TYPE")->value == "VIDEO")
+                        rep->addCodecs("avc1");
+                    else if(pair.second->getAttributeByName("TYPE")->value == "SUBTITLES")
+                        rep->addCodecs("wvtt");
+                }
 
                 if(!desc.empty())
                 {
@@ -522,6 +533,7 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
                 if(typeattr->value == "SUBTITLES")
                 {
                     altAdaptSet->setRole(Role(Role::ROLE_SUBTITLE));
+                    rep->streamFormat = StreamFormat(StreamFormat::UNSUPPORTED);
                 }
                 else if(typeattr->value != "AUDIO" && typeattr->value != "VIDEO")
                 {



More information about the vlc-commits mailing list