[FFmpeg-cvslog] lavfi/blend: merge config_input_top into config_output

Paul B Mahol git at videolan.org
Thu May 2 14:22:54 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu May  2 12:15:39 2013 +0000| [a64c9afe3de3718b37199a957bc2dd49dc3cc44b] | committer: Paul B Mahol

lavfi/blend: merge config_input_top into config_output

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a64c9afe3de3718b37199a957bc2dd49dc3cc44b
---

 libavfilter/vf_blend.c |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 17b168d..e855b28 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -295,13 +295,15 @@ static int config_output(AVFilterLink *outlink)
     AVFilterContext *ctx = outlink->src;
     AVFilterLink *toplink = ctx->inputs[TOP];
     AVFilterLink *bottomlink = ctx->inputs[BOTTOM];
+    BlendContext *b = ctx->priv;
+    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(toplink->format);
 
     if (toplink->format != bottomlink->format) {
         av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n");
         return AVERROR(EINVAL);
     }
-    if (toplink->w                        != bottomlink->w ||
-        toplink->h                        != bottomlink->h ||
+    if (toplink->w                       != bottomlink->w ||
+        toplink->h                       != bottomlink->h ||
         toplink->sample_aspect_ratio.num != bottomlink->sample_aspect_ratio.num ||
         toplink->sample_aspect_ratio.den != bottomlink->sample_aspect_ratio.den) {
         av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "
@@ -317,21 +319,15 @@ static int config_output(AVFilterLink *outlink)
     }
 
     outlink->w = toplink->w;
-    outlink->h = bottomlink->h;
+    outlink->h = toplink->h;
     outlink->time_base = toplink->time_base;
     outlink->sample_aspect_ratio = toplink->sample_aspect_ratio;
     outlink->frame_rate = toplink->frame_rate;
-    return 0;
-}
-
-static int config_input_top(AVFilterLink *inlink)
-{
-    BlendContext *b = inlink->dst->priv;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
 
     b->hsub = pix_desc->log2_chroma_w;
     b->vsub = pix_desc->log2_chroma_h;
-    b->nb_planes = av_pix_fmt_count_planes(inlink->format);
+    b->nb_planes = av_pix_fmt_count_planes(toplink->format);
+
     return 0;
 }
 
@@ -435,7 +431,6 @@ static const AVFilterPad blend_inputs[] = {
     {
         .name             = "top",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = config_input_top,
         .filter_frame     = filter_frame,
     },{
         .name             = "bottom",



More information about the ffmpeg-cvslog mailing list