[vlc-devel] [PATCH] demux: mkv: add ALAC atom size, tag and tag version to private data

Francois Cartegnie fcvlcdev at free.fr
Mon Feb 29 15:35:47 CET 2016


Le 29/02/2016 15:26, Tristan Matthews a écrit :
> +    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 );

I believe you haven't read the comment line above xmalloc definition.

> +    if (!p_tk->fmt.p_extra) { p_tk->fmt.i_extra = 0; return; };

Probably can refactor instead of set/unset, + likely().

> +    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 );

SetFOURCC(VLC_CODEC_ALAC) ?

> +    SetDWBE( p_extra + 8, 0 );
> +    memcpy( p_extra + 12, p_tk->p_extra_data, p_tk->fmt.i_extra - 12 );
> +}

Francois



More information about the vlc-devel mailing list