From 402f85f7f28842175f6a4ca2812e63d042506308 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 24 Aug 2013 15:17:37 +0200 Subject: sub: add webvtt-in-webm support The way this was added to FFmpeg is less than ideal, because it requires text parsing in the Matroska demuxer. But in order to use the FFmpeg webvtt-to-ass converter, we still have to mimic this in some way. We do this by putting the parsing into sd_lavc_conv.c, before the subtitle packet is passed to libavcodec. At least this keeps the ugliness out of unrelated code. There is some change that FFmpeg will fix their design eventually. Instead of rewriting the parsing code, we simply borrow it from FFmpeg's Matroska demuxer. --- demux/demux_mkv.c | 2 ++ demux/matroska.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'demux') diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index be356585e3..3e902c0ea3 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -1614,6 +1614,8 @@ static const char *mkv_sub_tag[][2] = { { MKV_S_TEXTASCII, "subrip"}, { MKV_S_TEXTUTF8, "subrip"}, { MKV_S_PGS, "hdmv_pgs_subtitle"}, + { MKV_S_WEBVTT_S, "webvtt-webm"}, + { MKV_S_WEBVTT_C, "webvtt-webm"}, {0} }; diff --git a/demux/matroska.h b/demux/matroska.h index 7682ead7a7..baadc84a97 100644 --- a/demux/matroska.h +++ b/demux/matroska.h @@ -88,5 +88,7 @@ #define MKV_S_PGS "S_HDMV/PGS" #define MKV_S_SSA "S_SSA" // Deprecated #define MKV_S_ASS "S_ASS" // Deprecated +#define MKV_S_WEBVTT_S "D_WEBVTT/SUBTITLES" +#define MKV_S_WEBVTT_C "D_WEBVTT/CAPTIONS" #endif /* MPLAYER_MATROSKA_H */ -- cgit v1.2.3