[vlc-commits] demux: hls: enable WEBVTT
Francois Cartegnie
git at videolan.org
Fri Nov 3 17:46:51 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Nov 3 14:14:33 2017 +0100| [ab9a4c23040bdacfd766b5e8ae02d8a428b4701b] | committer: Francois Cartegnie
demux: hls: enable WEBVTT
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ab9a4c23040bdacfd766b5e8ae02d8a428b4701b
---
modules/demux/hls/HLSStreams.cpp | 4 ++++
modules/demux/hls/playlist/Parser.cpp | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/modules/demux/hls/HLSStreams.cpp b/modules/demux/hls/HLSStreams.cpp
index aaea5206aa..b88aeb939f 100644
--- a/modules/demux/hls/HLSStreams.cpp
+++ b/modules/demux/hls/HLSStreams.cpp
@@ -87,6 +87,10 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format)
ret = new Demuxer(p_realdemux, "mp4", fakeesout->getEsOut(), demuxersource);
break;
+ case StreamFormat::WEBVTT:
+ ret = new Demuxer(p_realdemux, "webvttstream", fakeesout->getEsOut(), demuxersource);
+ break;
+
default:
case StreamFormat::UNSUPPORTED:
break;
diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 92672ba421..49bafc2107 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -93,6 +93,10 @@ void M3U8Parser::setFormatFromExtension(Representation *rep, const std::string &
{
rep->streamFormat = StreamFormat(StreamFormat::MP4);
}
+ else if(extension == "vtt" || extension == "wvtt" || extension == "webvtt")
+ {
+ rep->streamFormat = StreamFormat(StreamFormat::WEBVTT);
+ }
else
{
rep->streamFormat = StreamFormat(StreamFormat::UNSUPPORTED);
@@ -478,7 +482,8 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
/* Subtitles unsupported for now */
if(pair.second->getAttributeByName("TYPE")->value != "AUDIO" &&
- pair.second->getAttributeByName("TYPE")->value != "VIDEO")
+ pair.second->getAttributeByName("TYPE")->value != "VIDEO" &&
+ pair.second->getAttributeByName("TYPE")->value != "SUBTITLES" )
{
rep->streamFormat = StreamFormat(StreamFormat::UNSUPPORTED);
}
More information about the vlc-commits
mailing list