[vlc-devel] [PATCH 09/10] demux:mkv: do not write in subs if it's not a SPU_ES track
Steve Lhomme
robux4 at videolabs.io
Fri Jul 7 12:56:17 CEST 2017
---
modules/demux/mkv/matroska_segment_parse.cpp | 49 +++++++++++++++-------------
1 file changed, 26 insertions(+), 23 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 2ded415715..f2589ec07a 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1865,31 +1865,34 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
memcpy( psz_buf, p_tk->p_extra_data , p_tk->i_extra_data );
psz_buf[p_tk->i_extra_data] = '\0';
- psz_start = strstr( psz_buf, "size:" );
- if( psz_start &&
- vobsub_size_parse( psz_start,
- &p_tk->fmt.subs.spu.i_original_frame_width,
- &p_tk->fmt.subs.spu.i_original_frame_height ) == VLC_SUCCESS )
+ if (p_tk->fmt.i_cat == SPU_ES)
{
- msg_Dbg( vars.p_demuxer, "original frame size vobsubs: %dx%d",
- p_tk->fmt.subs.spu.i_original_frame_width,
- p_tk->fmt.subs.spu.i_original_frame_height );
- }
- else
- {
- msg_Warn( vars.p_demuxer, "reading original frame size for vobsub failed" );
- }
+ psz_start = strstr( psz_buf, "size:" );
+ if( psz_start &&
+ vobsub_size_parse( psz_start,
+ &p_tk->fmt.subs.spu.i_original_frame_width,
+ &p_tk->fmt.subs.spu.i_original_frame_height ) == VLC_SUCCESS )
+ {
+ msg_Dbg( vars.p_demuxer, "original frame size vobsubs: %dx%d",
+ p_tk->fmt.subs.spu.i_original_frame_width,
+ p_tk->fmt.subs.spu.i_original_frame_height );
+ }
+ else
+ {
+ msg_Warn( vars.p_demuxer, "reading original frame size for vobsub failed" );
+ }
- psz_start = strstr( psz_buf, "palette:" );
- if( psz_start &&
- vobsub_palette_parse( psz_start, &p_tk->fmt.subs.spu.palette[1] ) == VLC_SUCCESS )
- {
- p_tk->fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
- msg_Dbg( vars.p_demuxer, "vobsub palette read" );
- }
- else
- {
- msg_Warn( vars.p_demuxer, "reading original palette failed" );
+ psz_start = strstr( psz_buf, "palette:" );
+ if( psz_start &&
+ vobsub_palette_parse( psz_start, &p_tk->fmt.subs.spu.palette[1] ) == VLC_SUCCESS )
+ {
+ p_tk->fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
+ msg_Dbg( vars.p_demuxer, "vobsub palette read" );
+ }
+ else
+ {
+ msg_Warn( vars.p_demuxer, "reading original palette failed" );
+ }
}
free( psz_buf );
}
--
2.12.1
More information about the vlc-devel
mailing list