lavc: include timebase in avcodec string at debug level.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 17 Jan 2013 17:51:04 +0000 (18:51 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 24 Jan 2013 17:35:07 +0000 (18:35 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index bbf8f52..0844b24 100644 (file)
@@ -2120,6 +2120,15 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
                      ", %s", av_get_sample_fmt_name(enc->sample_fmt));
         }
         break;
+    case AVMEDIA_TYPE_DATA:
+        if (av_log_get_level() >= AV_LOG_DEBUG) {
+            int g = av_gcd(enc->time_base.num, enc->time_base.den);
+            if (g)
+                snprintf(buf + strlen(buf), buf_size - strlen(buf),
+                         ", %d/%d",
+                         enc->time_base.num / g, enc->time_base.den / g);
+        }
+        break;
     default:
         return;
     }