From c599e297e714b572e1bea2f4e59c319dce13b174 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sun, 23 Mar 2008 15:43:29 +0000 Subject: Pass AACAC3ParseContext to sync() instead of individual arguments. Patch by Bartlomiej Wolowiec (bartek wolowiec gmail com) Originally committed as revision 12564 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/aac_ac3_parser.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'libavcodec/aac_ac3_parser.c') diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c index 999a189158..c72965a76f 100644 --- a/libavcodec/aac_ac3_parser.c +++ b/libavcodec/aac_ac3_parser.c @@ -30,7 +30,7 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, { AACAC3ParseContext *s = s1->priv_data; const uint8_t *buf_ptr; - int len, sample_rate, bit_rate, channels, samples; + int len; *poutbuf = NULL; *poutbuf_size = 0; @@ -50,8 +50,7 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, if (s->frame_size == 0) { if ((s->inbuf_ptr - s->inbuf) == s->header_size) { - len = s->sync(s->inbuf, &channels, &sample_rate, &bit_rate, - &samples); + len = s->sync(s); if (len == 0) { /* no sync found : move by one byte (inefficient, but simple!) */ memmove(s->inbuf, s->inbuf + 1, s->header_size - 1); @@ -59,19 +58,19 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, } else { s->frame_size = len; /* update codec info */ - avctx->sample_rate = sample_rate; + avctx->sample_rate = s->sample_rate; /* allow downmixing to stereo (or mono for AC3) */ if(avctx->request_channels > 0 && - avctx->request_channels < channels && + avctx->request_channels < s->channels && (avctx->request_channels <= 2 || (avctx->request_channels == 1 && avctx->codec_id == CODEC_ID_AC3))) { avctx->channels = avctx->request_channels; } else { - avctx->channels = channels; + avctx->channels = s->channels; } - avctx->bit_rate = bit_rate; - avctx->frame_size = samples; + avctx->bit_rate = s->bit_rate; + avctx->frame_size = s->samples; } } } else { -- cgit v1.2.3