[vlc-commits] demux: adaptive: declare codecs for MIME only ttml/webvtt
Francois Cartegnie
git at videolan.org
Thu Nov 21 11:16:57 CET 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 21 14:28:31 2019 +0900| [28f082add71568b9b56fd0f3febc97c34ac91186] | committer: Francois Cartegnie
demux: adaptive: declare codecs for MIME only ttml/webvtt
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28f082add71568b9b56fd0f3febc97c34ac91186
---
modules/demux/adaptive/Streams.cpp | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 9bee3c4396..bff61f1088 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -671,11 +671,36 @@ void AbstractStream::trackerEvent(const SegmentTrackerEvent &event)
}
}
+static void add_codec_string_from_fourcc(vlc_fourcc_t fourcc,
+ std::list<std::string> &codecs)
+{
+ std::string codec;
+ codec.insert(0, reinterpret_cast<const char *>(&fourcc), 4);
+ codecs.push_back(codec);
+}
+
void AbstractStream::declaredCodecs()
{
const std::string & streamDesc = segmentTracker->getStreamDescription();
const std::string & streamLang = segmentTracker->getStreamLanguage();
std::list<std::string> codecs = segmentTracker->getCurrentCodecs();
+
+ if(codecs.empty())
+ {
+ const StreamFormat format = segmentTracker->getCurrentFormat();
+ switch(format)
+ {
+ case StreamFormat::TTML:
+ add_codec_string_from_fourcc(VLC_CODEC_TTML, codecs);
+ break;
+ case StreamFormat::WEBVTT:
+ add_codec_string_from_fourcc(VLC_CODEC_WEBVTT, codecs);
+ break;
+ default:
+ break;
+ }
+ }
+
for(std::list<std::string>::const_iterator it = codecs.begin();
it != codecs.end(); ++it)
{
More information about the vlc-commits
mailing list