[FFmpeg-cvslog] avcodec/audiotoolboxdec: check packet side data for AAC extradata updates
James Almer
git at videolan.org
Thu May 25 07:27:21 EEST 2017
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed May 24 23:37:04 2017 -0300| [954e2b3d34b7c2d82871254f07e2f8a39bc451cb] | committer: James Almer
avcodec/audiotoolboxdec: check packet side data for AAC extradata updates
Tested-by: rcombs
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=954e2b3d34b7c2d82871254f07e2f8a39bc451cb
---
libavcodec/audiotoolboxdec.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index 04a9be9fcb..a8655f0421 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -504,8 +504,20 @@ static int ffat_decode(AVCodecContext *avctx, void *data,
if ((ret = av_bsf_receive_packet(at->bsf, &filtered_packet)) < 0)
return ret;
- at->extradata = at->bsf->par_out->extradata;
- at->extradata_size = at->bsf->par_out->extradata_size;
+ if (!at->extradata_size) {
+ uint8_t *side_data;
+ int side_data_size = 0;
+
+ side_data = av_packet_get_side_data(&filtered_packet, AV_PKT_DATA_NEW_EXTRADATA,
+ &side_data_size);
+ if (side_data_size) {
+ at->extradata = av_mallocz(side_data_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!at->extradata)
+ return AVERROR(ENOMEM);
+ at->extradata_size = side_data_size;
+ memcpy(at->extradata, side_data, side_data_size);
+ }
+ }
avpkt = &filtered_packet;
}
More information about the ffmpeg-cvslog
mailing list