[FFmpeg-cvslog] avcodec/flac_parser: export sample_rate also when PARSER_FLAG_COMPLETE_FRAMES is set

Michael Niedermayer git at videolan.org
Mon Oct 7 01:53:27 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Oct  7 01:11:22 2013 +0200| [630c005b879ad23114a55864426e9c9e0eec9668] | committer: Michael Niedermayer

avcodec/flac_parser: export sample_rate also when PARSER_FLAG_COMPLETE_FRAMES is set

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=630c005b879ad23114a55864426e9c9e0eec9668
---

 libavcodec/flac_parser.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c
index 69c2965..ba1f060 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;



More information about the ffmpeg-cvslog mailing list