diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2008-03-23 15:43:29 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2008-03-23 15:43:29 +0000 |
commit | c599e297e714b572e1bea2f4e59c319dce13b174 (patch) | |
tree | ec77afb8956ddb004532847b0908f5c645eb6592 /libavcodec/aac_ac3_parser.c | |
parent | 721392606bafd5a6971cce2d93fe5d0bc2a76927 (diff) | |
download | ffmpeg-c599e297e714b572e1bea2f4e59c319dce13b174.tar.gz |
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
Diffstat (limited to 'libavcodec/aac_ac3_parser.c')
-rw-r--r-- | libavcodec/aac_ac3_parser.c | 15 |
1 files changed, 7 insertions, 8 deletions
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 { |