avcodec/aacdec: remove skip samples multiplier

The amount of padding samples reported by containers take into account the
extended samplerate in HE-AAC.

Fixes ticket #9671.

Signed-off-by: James Almer <jamrial@gmail.com>
pull/388/head
James Almer 3 years ago
parent 130d19bf20
commit 5114ce1e2a
  1. 3
      libavcodec/aacdec_template.c
  2. 2
      libavcodec/avcodec.c
  3. 2
      libavcodec/decode.c
  4. 2
      libavcodec/internal.h
  5. 2
      tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a
  6. 2
      tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a
  7. 2
      tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a
  8. 2
      tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a
  9. 2
      tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a
  10. 2
      tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a
  11. 2
      tests/ref/fate/audiomatch-nero-16000-mono-he-m4a
  12. 2
      tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a
  13. 2
      tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a
  14. 2
      tests/ref/fate/audiomatch-nero-44100-mono-he-m4a
  15. 2
      tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a
  16. 2
      tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a

@ -3418,9 +3418,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame,
ac->oc[1].status = OC_LOCKED;
}
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");
err = AVERROR_INVALIDDATA;

@ -161,8 +161,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
avci->skip_samples_multiplier = 1;
if (codec2->priv_data_size > 0) {
if (!avctx->priv_data) {
avctx->priv_data = av_mallocz(codec2->priv_data_size);

@ -359,7 +359,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
side= av_packet_get_side_data(avci->last_pkt_props, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
if(side && side_size>=10) {
avci->skip_samples = AV_RL32(side) * avci->skip_samples_multiplier;
avci->skip_samples = AV_RL32(side);
avci->skip_samples = FFMAX(0, avci->skip_samples);
discard_padding = AV_RL32(side + 4);
av_log(avctx, AV_LOG_DEBUG, "skip %d / discard %d samples due to side data\n",

@ -133,8 +133,6 @@ typedef struct AVCodecInternal {
int showed_multi_packet_warning;
int skip_samples_multiplier;
/* to prevent infinite loop on errors when draining */
int nb_draining_errors;

@ -1 +1 @@
presig: 481 postsig:223 c: 0.9835 lenerr:704
presig: 1537 postsig:223 c: 0.9835 lenerr:1760

@ -1 +1 @@
presig: 962 postsig:446 c: 0.9895 lenerr:1408
presig: 3074 postsig:446 c: 0.9895 lenerr:3520

@ -1 +1 @@
presig: 962 postsig:446 c: 0.9839 lenerr:1408
presig: 3074 postsig:446 c: 0.9839 lenerr:3520

@ -1 +1 @@
presig: 962 postsig:822 c: 0.9911 lenerr:1784
presig: 3074 postsig:822 c: 0.9911 lenerr:3896

@ -1 +1 @@
presig: 1924 postsig:1644 c: 0.9890 lenerr:3568
presig: 6148 postsig:1644 c: 0.9890 lenerr:7792

@ -1 +1 @@
presig: 1924 postsig:1644 c: 0.9909 lenerr:3568
presig: 6148 postsig:1644 c: 0.9909 lenerr:7792

@ -1 +1 @@
presig: -4 postsig:196 c: 0.9736 lenerr:192
presig: 2332 postsig:196 c: 0.9736 lenerr:2528

@ -1 +1 @@
presig: -8 postsig:392 c: 0.9777 lenerr:384
presig: 4664 postsig:392 c: 0.9777 lenerr:5056

@ -1 +1 @@
presig: 2 postsig:2590 c: 0.9934 lenerr:2592
presig: 5618 postsig:2590 c: 0.9934 lenerr:8208

@ -1 +1 @@
presig: 0 postsig:1336 c: 0.9973 lenerr:1336
presig: 2336 postsig:1336 c: 0.9973 lenerr:3672

@ -1 +1 @@
presig: -2 postsig:2674 c: 0.9986 lenerr:2672
presig: 4670 postsig:2674 c: 0.9986 lenerr:7344

@ -1 +1 @@
presig: 2 postsig:782 c: 0.9980 lenerr:784
presig: 5618 postsig:782 c: 0.9980 lenerr:6400

Loading…
Cancel
Save