mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
free faac extradata
Originally committed as revision 8161 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
c52ff68852
commit
4c02e46daf
@ -76,15 +76,19 @@ static int Faac_encode_init(AVCodecContext *avctx)
|
|||||||
avctx->extradata_size = 0;
|
avctx->extradata_size = 0;
|
||||||
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
|
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
|
||||||
|
|
||||||
unsigned char *buffer;
|
unsigned char *buffer = NULL;
|
||||||
unsigned long decoder_specific_info_size;
|
unsigned long decoder_specific_info_size;
|
||||||
|
|
||||||
if (!faacEncGetDecoderSpecificInfo(s->faac_handle, &buffer,
|
if (!faacEncGetDecoderSpecificInfo(s->faac_handle, &buffer,
|
||||||
&decoder_specific_info_size)) {
|
&decoder_specific_info_size)) {
|
||||||
avctx->extradata = buffer;
|
avctx->extradata = av_malloc(decoder_specific_info_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
avctx->extradata_size = decoder_specific_info_size;
|
avctx->extradata_size = decoder_specific_info_size;
|
||||||
|
memcpy(avctx->extradata, buffer, avctx->extradata_size);
|
||||||
faac_cfg->outputFormat = 0;
|
faac_cfg->outputFormat = 0;
|
||||||
}
|
}
|
||||||
|
#undef free
|
||||||
|
free(buffer);
|
||||||
|
#define free please_use_av_free
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
|
if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
|
||||||
@ -115,8 +119,7 @@ static int Faac_encode_close(AVCodecContext *avctx)
|
|||||||
FaacAudioContext *s = avctx->priv_data;
|
FaacAudioContext *s = avctx->priv_data;
|
||||||
|
|
||||||
av_freep(&avctx->coded_frame);
|
av_freep(&avctx->coded_frame);
|
||||||
|
av_freep(&avctx->extradata);
|
||||||
//if (avctx->extradata_size) free(avctx->extradata);
|
|
||||||
|
|
||||||
faacEncClose(s->faac_handle);
|
faacEncClose(s->faac_handle);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user