[FFmpeg-devel] [PATCH] Allow autodetecting PS and SBR for AAC without extradata.

Michael Niedermayer michaelni at gmx.at
Tue Aug 16 01:59:07 CEST 2011


On Wed, Aug 10, 2011 at 09:02:08PM +0200, Reimar Döffinger wrote:
> This was possible before and was broken when this code was added.
> 
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  libavcodec/aacdec.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
> index 944be9f..b8d5865 100644
> --- a/libavcodec/aacdec.c
> +++ b/libavcodec/aacdec.c
> @@ -578,6 +578,10 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
>          int sr, i;
>          enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
>  
> +        // Allow these to be detected later
> +        ac->m4ac.sbr = -1;
> +        ac->m4ac.ps  = -1;
> +
>          sr = sample_rate_idx(avctx->sample_rate);
>          ac->m4ac.sampling_index = sr;
>          ac->m4ac.channels = avctx->channels;
> @@ -593,7 +597,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
>          if (ac->m4ac.chan_config) {
>              int ret = set_default_channel_config(avctx, new_che_pos, ac->m4ac.chan_config);
>              if (!ret)
> -                output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_GLOBAL_HDR);
> +                output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_NONE);
>              else if (avctx->error_recognition >= FF_ER_EXPLODE)
>                  return AVERROR_INVALIDDATA;
>          }

iam CCing that to alex, as i think he wrote this and might have some
comments


[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110816/45b932a6/attachment.asc>


More information about the ffmpeg-devel mailing list