print more time_base fps stuff if av_log level is at debug or above

print more likely correct fps
not sure if this is formated optimally ...

Originally committed as revision 4596 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer
2005-09-18 14:45:17 +00:00
parent 357a28430a
commit 2118901192
2 changed files with 13 additions and 3 deletions

View File

@@ -1072,9 +1072,14 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
}
if (enc->width) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %dx%d, %0.2f fps",
enc->width, enc->height,
1/av_q2d(enc->time_base));
", %dx%d",
enc->width, enc->height);
if(av_log_get_level() >= AV_LOG_DEBUG){
int g= ff_gcd(enc->time_base.num, enc->time_base.den);
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %d/%d",
enc->time_base.num/g, enc->time_base.den/g);
}
}
if (encode) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),