diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-12 14:59:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-12 15:00:03 +0100 |
commit | 8c5fece11fcb845f459eebb86b03f98d39e5880c (patch) | |
tree | a07ddbe4933e3934756d6459df3f4b82218a65a4 /libavcodec | |
parent | 1bc3f1b73dfff1a23b9bad1d4fef32dcced47f64 (diff) | |
parent | 462d5e8e6c050eae7cbb1f2d5c34628088bd0eb6 (diff) | |
download | ffmpeg-8c5fece11fcb845f459eebb86b03f98d39e5880c.tar.gz |
Merge commit '462d5e8e6c050eae7cbb1f2d5c34628088bd0eb6'
* commit '462d5e8e6c050eae7cbb1f2d5c34628088bd0eb6':
aacdec: set AVFrame sample_rate
Conflicts:
libavcodec/aacdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aacdec.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index a420c3643a..3586aabbe7 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -2872,6 +2872,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data, spectral_to_sample(ac); ac->frame->nb_samples = samples; + ac->frame->sample_rate = avctx->sample_rate; *got_frame_ptr = 1; skip_bits_long(gb, get_bits_left(gb)); @@ -3006,22 +3007,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data, multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0; samples <<= multiplier; - /* for dual-mono audio (SCE + SCE) */ - is_dmono = ac->dmono_mode && sce_count == 2 && - ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT); - - if (samples) - ac->frame->nb_samples = samples; - else - av_frame_unref(ac->frame); - *got_frame_ptr = !!samples; - - if (is_dmono) { - if (ac->dmono_mode == 1) - ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0]; - else if (ac->dmono_mode == 2) - ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1]; - } if (ac->oc[1].status && audio_found) { avctx->sample_rate = ac->oc[1].m4ac.sample_rate << multiplier; @@ -3035,6 +3020,25 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data, if (side && side_size>=4) AV_WL32(side, 2*AV_RL32(side)); } + + *got_frame_ptr = !!samples; + if (samples) { + ac->frame->nb_samples = samples; + ac->frame->sample_rate = avctx->sample_rate; + } else + av_frame_unref(ac->frame); + *got_frame_ptr = !!samples; + + /* for dual-mono audio (SCE + SCE) */ + is_dmono = ac->dmono_mode && sce_count == 2 && + ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT); + if (is_dmono) { + if (ac->dmono_mode == 1) + ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0]; + else if (ac->dmono_mode == 2) + ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1]; + } + return 0; fail: pop_output_configuration(ac); |