Commit 7fc502fe authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg: support for libavcodec's flac decoder.

parent 07f79785
......@@ -112,11 +112,20 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
if( ( p_sys->p_context->extradata_size = p_dec->fmt_in.i_extra ) > 0 )
{
int i_offset = 0;
if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', 'a', 'c' ) )
i_offset = 8;
p_sys->p_context->extradata_size -= i_offset;
p_sys->p_context->extradata =
malloc( p_dec->fmt_in.i_extra + FF_INPUT_BUFFER_PADDING_SIZE );
malloc( p_sys->p_context->extradata_size +
FF_INPUT_BUFFER_PADDING_SIZE );
memcpy( p_sys->p_context->extradata,
p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
memset( (char*)p_sys->p_context->extradata + p_dec->fmt_in.i_extra, 0,
p_dec->fmt_in.p_extra + i_offset,
p_sys->p_context->extradata_size );
memset( (char*)p_sys->p_context->extradata +
p_sys->p_context->extradata_size, 0,
FF_INPUT_BUFFER_PADDING_SIZE );
}
......
......@@ -873,6 +873,12 @@ static struct
AUDIO_ES, "AMR wide band" },
#endif
#if LIBAVCODEC_BUILD >= 4703
/* FLAC */
{ VLC_FOURCC('f','l','a','c'), CODEC_ID_FLAC,
AUDIO_ES, "FLAC (Free Lossless Audio Codec)" },
#endif
#if LIBAVCODEC_BUILD >= 4745
/* ALAC */
{ VLC_FOURCC('a','l','a','c'), CODEC_ID_ALAC,
......
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