[FFmpeg-devel] [PATCH]Fix fps diplay for very small fps

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Apr 3 14:14:34 CEST 2015


Hi!

Attached patch improves "ffmpeg -i" output for the sample from 
ticket #4393.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 56b37ff..9a7035c 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -118,7 +118,9 @@ void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_paylo
 static void print_fps(double d, const char *postfix)
 {
     uint64_t v = lrintf(d * 100);
-    if (v % 100)
+    if (!v)
+        av_log(NULL, AV_LOG_INFO, "%1.4f %s", d, postfix);
+    else if (v % 100)
         av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix);
     else if (v % (100 * 1000))
         av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix);


More information about the ffmpeg-devel mailing list