avformat/utils: Call ff_rfps_add_frame() only for video
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Jun 2014 15:09:53 +0000 (17:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Jun 2014 15:09:53 +0000 (17:09 +0200)
This avoids some unneeded computations

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 6df426b..d761768 100644 (file)
@@ -3328,7 +3328,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
             }
         }
 #if FF_API_R_FRAME_RATE
-        ff_rfps_add_frame(ic, st, pkt->dts);
+        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
+            ff_rfps_add_frame(ic, st, pkt->dts);
 #endif
         if (st->parser && st->parser->parser->split && !st->codec->extradata) {
             int i = st->parser->parser->split(st->codec, pkt->data, pkt->size);