[vlc-commits] demux:mkv: do not write in subs if it's not a SPU_ES track
Steve Lhomme
git at videolan.org
Sat Jul 8 18:39:28 CEST 2017
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Jul 6 15:09:49 2017 +0200| [9bca6141a76477beac3376162a8ff6e482fd02d4] | committer: Jean-Baptiste Kempf
demux:mkv: do not write in subs if it's not a SPU_ES track
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9bca6141a76477beac3376162a8ff6e482fd02d4
---
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 7766e37aa6..d640bc4b29 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1875,31 +1875,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 );
}
More information about the vlc-commits
mailing list