diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-07 01:11:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-07 01:36:05 +0200 |
commit | 630c005b879ad23114a55864426e9c9e0eec9668 (patch) | |
tree | 61f9eb536ab7b4e50a3acfb404c11cb368a6c28e /libavcodec/flac_parser.c | |
parent | ee3d03bf4ec6c4e5b9eec20a6f69d39d617a2980 (diff) | |
download | ffmpeg-630c005b879ad23114a55864426e9c9e0eec9668.tar.gz |
avcodec/flac_parser: export sample_rate also when PARSER_FLAG_COMPLETE_FRAMES is set
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flac_parser.c')
-rw-r--r-- | libavcodec/flac_parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index 69c2965f65..ba1f060fd9 100644 --- a/libavcodec/flac_parser.c +++ b/libavcodec/flac_parser.c @@ -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; |