[FFmpeg-devel] [PATCH] lavfi/aspect: extend verbose feedback, show old SAR values

Stefano Sabatini stefasab at gmail.com
Tue Apr 16 22:39:25 CEST 2013


---
 libavfilter/vf_aspect.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index e1f616b..e45784e 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -85,6 +85,7 @@ static int setdar_config_props(AVFilterLink *inlink)
 {
     AspectContext *aspect = inlink->dst->priv;
     AVRational dar = aspect->aspect;
+    AVRational old_sar = inlink->sample_aspect_ratio;
 
     if (aspect->aspect.num && aspect->aspect.den) {
         av_reduce(&aspect->aspect.num, &aspect->aspect.den,
@@ -96,9 +97,9 @@ static int setdar_config_props(AVFilterLink *inlink)
         dar = (AVRational){ inlink->w, inlink->h };
     }
 
-    av_log(inlink->dst, AV_LOG_VERBOSE, "w:%d h:%d -> dar:%d/%d sar:%d/%d\n",
-           inlink->w, inlink->h, dar.num, dar.den,
-           inlink->sample_aspect_ratio.num, inlink->sample_aspect_ratio.den);
+    av_log(inlink->dst, AV_LOG_VERBOSE, "w:%d h:%d sar:%d/%d -> dar:%d/%d sar:%d/%d\n",
+           inlink->w, inlink->h, old_sar.num, old_sar.den,
+           dar.den, dar.num, inlink->sample_aspect_ratio.num, inlink->sample_aspect_ratio.den);
 
     return 0;
 }
@@ -156,13 +157,17 @@ AVFilter avfilter_vf_setdar = {
 
 #if CONFIG_SETSAR_FILTER
 
-
 static int setsar_config_props(AVFilterLink *inlink)
 {
     AspectContext *aspect = inlink->dst->priv;
+    AVRational old_sar = inlink->sample_aspect_ratio;
 
     inlink->sample_aspect_ratio = aspect->aspect;
 
+    av_log(inlink->dst, AV_LOG_VERBOSE, "w:%d h:%d sar:%d/%d -> sar:%d/%d\n",
+           inlink->w, inlink->h, old_sar.num, old_sar.den,
+           inlink->sample_aspect_ratio.num, inlink->sample_aspect_ratio.den);
+
     return 0;
 }
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list