Commit 7fc502fe authored by gbazin's avatar gbazin

* 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, ...@@ -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 ) 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 = 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, memcpy( p_sys->p_context->extradata,
p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra ); p_dec->fmt_in.p_extra + i_offset,
memset( (char*)p_sys->p_context->extradata + p_dec->fmt_in.i_extra, 0, 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 ); FF_INPUT_BUFFER_PADDING_SIZE );
} }
......
...@@ -873,6 +873,12 @@ static struct ...@@ -873,6 +873,12 @@ static struct
AUDIO_ES, "AMR wide band" }, AUDIO_ES, "AMR wide band" },
#endif #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 #if LIBAVCODEC_BUILD >= 4745
/* ALAC */ /* ALAC */
{ VLC_FOURCC('a','l','a','c'), CODEC_ID_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