Revision c132938d

View differences:

libavformat/utils.c
2755 2755
    }
2756 2756
}
2757 2757

  
2758
static void print_fps(double d, const char *postfix){
2759
    uint64_t v= lrintf(d*100);
2760
    if     (v% 100      ) av_log(NULL, AV_LOG_INFO, ", %3.2f %s", d, postfix);
2761
    else if(v%(100*1000)) av_log(NULL, AV_LOG_INFO, ", %1.0f %s", d, postfix);
2762
    else                  av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d/1000, postfix);
2763
}
2764

  
2758 2765
/* "user interface" functions */
2759 2766
static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
2760 2767
{
......
2785 2792
    }
2786 2793
    if(st->codec->codec_type == CODEC_TYPE_VIDEO){
2787 2794
        if(st->r_frame_rate.den && st->r_frame_rate.num)
2788
            av_log(NULL, AV_LOG_INFO, ", %5.2f tb(r)", av_q2d(st->r_frame_rate));
2795
            print_fps(av_q2d(st->r_frame_rate), "tbr");
2789 2796
        if(st->time_base.den && st->time_base.num)
2790
            av_log(NULL, AV_LOG_INFO, ", %5.2f tb(m)", 1/av_q2d(st->time_base));
2797
            print_fps(1/av_q2d(st->time_base), "tbn");
2791 2798
        if(st->codec->time_base.den && st->codec->time_base.num)
2792
            av_log(NULL, AV_LOG_INFO, ", %5.2f tb(c)", 1/av_q2d(st->codec->time_base));
2799
            print_fps(1/av_q2d(st->codec->time_base), "tbc");
2793 2800
    }
2794 2801
    av_log(NULL, AV_LOG_INFO, "\n");
2795 2802
}

Also available in: Unified diff