summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacdec_template.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-03-08 12:36:05 +0100
committerwm4 <nfxjfg@googlemail.com>2017-03-09 10:16:12 +0100
commitfcfc78cbabb6b454aa9e39ad32ae7a766dcf33d8 (patch)
tree56d74ac12da56ee6e5d222bf76ef1f86ef38ba8b /libavcodec/aacdec_template.c
parent53a5cea478616d2caa1c07aa58b6b911bd80c285 (diff)
downloadffmpeg-streaming-fcfc78cbabb6b454aa9e39ad32ae7a766dcf33d8.zip
ffmpeg-streaming-fcfc78cbabb6b454aa9e39ad32ae7a766dcf33d8.tar.gz
aacdec: do not mutate input packet metadata
Apparently the demuxer outputs the wrong padding for HE-AAC (based on the raw sample rate, or so). aacdec contains a hack to adjust the muxer padding accordingly before it's used to trim the decoder output. This modified the packet side data, which in combination with the old decoding API would change the packet the user passed to the decoder. This is clearly not allowed, and it breaks running some gapless fate tests with "-fflags +keepside" applied (without keepside, the packet metadata is typically newly allocated, essentially making a copy and not modifying the user's input packet). This should probably be fixed in the demuxer (and consequently also the muxer), but for now only fix the immediate problem. Regression since 946ed78f5f8 (2012).
Diffstat (limited to 'libavcodec/aacdec_template.c')
-rw-r--r--libavcodec/aacdec_template.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 4367e74..98a3240 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -3095,12 +3095,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
ac->oc[1].status = OC_LOCKED;
}
- if (multiplier) {
- int side_size;
- const uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
- if (side && side_size>=4)
- AV_WL32(side, 2*AV_RL32(side));
- }
+ if (multiplier)
+ avctx->internal->skip_samples_multiplier = 2;
if (!ac->frame->data[0] && samples) {
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
OpenPOWER on IntegriCloud