Commit 52944430 authored by Tristan Matthews's avatar Tristan Matthews

demux: mkv: add ALAC atom size, tag and tag version to private data

Fixes #16620
parent 0135c943
......@@ -44,6 +44,21 @@ 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.p_extra = malloc( p_tk->i_extra_data + 12 );
if( unlikely( !p_tk->fmt.p_extra ) ) return;
p_tk->fmt.i_extra = p_tk->i_extra_data + 12;
uint8_t *p_extra = (uint8_t *)p_tk->fmt.p_extra;
/* See "ALAC Specific Info (36 bytes) (required)" from
alac.macosforge.org/trac/browser/trunk/ALACMagicCookieDescription.txt */
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 +1643,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" ) )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment