avcodec/flac_parser: export sample_rate also when PARSER_FLAG_COMPLETE_FRAMES is set

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-10-07 01:11:22 +02:00
parent ee3d03bf4e
commit 630c005b87

View File

@ -512,8 +512,11 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
FLACFrameInfo fi;
if (frame_header_is_valid(avctx, buf, &fi))
if (frame_header_is_valid(avctx, buf, &fi)) {
s->duration = fi.blocksize;
if (!avctx->sample_rate)
avctx->sample_rate = fi.samplerate;
}
*poutbuf = buf;
*poutbuf_size = buf_size;
return buf_size;