[vlc-devel] [PATCH] demux: mkv: add ALAC atom size, tag and tag version to private data
Tristan Matthews
tmatth at videolan.org
Mon Feb 29 15:26:08 CET 2016
Fixes #16620
---
modules/demux/mkv/matroska_segment_parse.cpp | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index c0ab042..c5d83dc 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -44,6 +44,19 @@ static vlc_fourcc_t __GetFOURCC( uint8_t *p )
return VLC_FOURCC( p[0], p[1], p[2], p[3] );
}
+static inline void fill_extra_data_alac( mkv_track_t *p_tk )
+{
+ if (p_tk->i_extra_data <= 0 ) return;
+ p_tk->fmt.i_extra = p_tk->i_extra_data + 12;
+ p_tk->fmt.p_extra = xmalloc( p_tk->fmt.i_extra );
+ if (!p_tk->fmt.p_extra) { p_tk->fmt.i_extra = 0; return; };
+ uint8_t *p_extra = (uint8_t *)p_tk->fmt.p_extra;
+ SetDWBE( p_extra, p_tk->fmt.i_extra );
+ memcpy( p_extra + 4, "alac", 4 );
+ SetDWBE( p_extra + 8, 0 );
+ memcpy( p_extra + 12, p_tk->p_extra_data, p_tk->fmt.i_extra - 12 );
+}
+
static inline void fill_extra_data( mkv_track_t *p_tk, unsigned int offset )
{
if(p_tk->i_extra_data <= offset) return;
@@ -1628,7 +1641,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
else if( !strcmp( p_tk->psz_codec, "A_ALAC" ) )
{
p_tk->fmt.i_codec = VLC_CODEC_ALAC;
- fill_extra_data( p_tk, 0 );
+ fill_extra_data_alac( p_tk );
}
else if( !strcmp( p_tk->psz_codec, "A_WAVPACK4" ) )
{
--
1.9.1
More information about the vlc-devel
mailing list