diff options
author | James Almer <jamrial@gmail.com> | 2017-04-10 13:36:19 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-05-24 20:28:00 -0300 |
commit | f63c3516577d605e51cf16358cbdfa0bc97565d8 (patch) | |
tree | 008a031e9a2b1531ccbc0c32db4bfb5e6f2e1f11 /libavcodec | |
parent | 210388a1979d70d024ef4ebf1d97df56ce56b0c1 (diff) | |
download | ffmpeg-f63c3516577d605e51cf16358cbdfa0bc97565d8.tar.gz |
avcodec/aac_adtstoasc: propagate new extradata using packet side data
This removes the current API violating behavior of overwritting the stream's
extradata during packet filtering, something that should not happen after the
av_bsf_init() call.
The bitstream filter generated extradata is no longer available during
write_header(), and as such not usable with non seekable output. The FATE
tests are updated to reflect this.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aac_adtstoasc_bsf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c index e116b1d85b..4bcf55b193 100644 --- a/libavcodec/aac_adtstoasc_bsf.c +++ b/libavcodec/aac_adtstoasc_bsf.c @@ -97,7 +97,8 @@ static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *out) in->data += get_bits_count(&gb)/8; } - extradata = av_mallocz(2 + pce_size + AV_INPUT_BUFFER_PADDING_SIZE); + extradata = av_packet_new_side_data(in, AV_PKT_DATA_NEW_EXTRADATA, + 2 + pce_size); if (!extradata) { ret = AVERROR(ENOMEM); goto fail; @@ -115,8 +116,6 @@ static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *out) memcpy(extradata + 2, pce_data, pce_size); } - bsfc->par_out->extradata = extradata; - bsfc->par_out->extradata_size = 2 + pce_size; ctx->first_frame_done = 1; } |