Browse Source

Fix codec fps diplay for very small fps.

Fixes codec banner for the sample from ticket #4369.
tags/n2.7
Carl Eugen Hoyos 10 years ago
parent
commit
c4367f950d
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/dump.c

+ 3
- 1
libavformat/dump.c View File

@@ -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) static void print_fps(double d, const char *postfix)
{ {
uint64_t v = lrintf(d * 100); 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); av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix);
else if (v % (100 * 1000)) else if (v % (100 * 1000))
av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix); av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix);


Loading…
Cancel
Save