[vlc-commits] demux: mkv: map webvtt
Francois Cartegnie
git at videolan.org
Tue Oct 31 22:47:18 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Oct 27 10:11:30 2017 +0200| [90af0919f3f7b17bf186628b73d04d2ca016f52a] | committer: Francois Cartegnie
demux: mkv: map webvtt
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=90af0919f3f7b17bf186628b73d04d2ca016f52a
---
modules/demux/mkv/matroska_segment_parse.cpp | 4 ++++
modules/demux/mkv/mkv.cpp | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index edc7c9880a..2e5ae019d1 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -2037,6 +2037,10 @@ bool matroska_segment_c::TrackInit( mkv_track_t * p_tk )
vars.p_fmt->i_codec = VLC_CODEC_SUBT;
vars.p_fmt->subs.psz_encoding = strdup( "UTF-8");
}
+ S_CASE("S_TEXT/WEBVTT") {
+ vars.p_fmt->i_codec = VLC_CODEC_WEBVTT;
+ vars.p_fmt->subs.psz_encoding = strdup( "UTF-8");
+ }
S_CASE("B_VOBBTN") {
vars.p_fmt->i_cat = DATA_ES;
}
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 4fe1559059..e11f6f922d 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -607,6 +607,18 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
continue;
}
+ case VLC_CODEC_WEBVTT:
+ {
+ p_block = block_Realloc( p_block, 16, p_block->i_buffer );
+ if( !p_block )
+ continue;
+ SetDWBE( p_block->p_buffer, p_block->i_buffer );
+ memcpy( &p_block->p_buffer[4], "vttc", 4 );
+ SetDWBE( &p_block->p_buffer[8], p_block->i_buffer - 8 );
+ memcpy( &p_block->p_buffer[12], "payl", 4 );
+ }
+ break;
+
case VLC_CODEC_OPUS:
mtime_t i_length = i_duration * track. f_timecodescale *
(double) p_segment->i_timescale / 1000.0;
More information about the vlc-commits
mailing list