[FFmpeg-cvslog] r20660 - trunk/libavfilter/vf_scale.c

stefano subversion
Sun Nov 29 19:02:19 CET 2009


Author: stefano
Date: Sun Nov 29 19:02:19 2009
New Revision: 20660

Log:
Use the correct chroma values for the data[] array used in
draw_slice().

The chroma values to use are supposed to be those of the input format,
not that of the output format, the latter case was causing crashes and
chroma issues.

Modified:
   trunk/libavfilter/vf_scale.c

Modified: trunk/libavfilter/vf_scale.c
==============================================================================
--- trunk/libavfilter/vf_scale.c	Sun Nov 29 18:40:53 2009	(r20659)
+++ trunk/libavfilter/vf_scale.c	Sun Nov 29 19:02:19 2009	(r20660)
@@ -115,8 +115,6 @@ static int config_props(AVFilterLink *ou
     av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s\n",
            outlink->w, outlink->h, avcodec_get_pix_fmt_name(outlink->format));
 
-    avcodec_get_chroma_sub_sample(outlink->format, &scale->hsub, &scale->vsub);
-
     scale->input_is_pal = inlink->format == PIX_FMT_PAL8      ||
                           inlink->format == PIX_FMT_BGR4_BYTE ||
                           inlink->format == PIX_FMT_RGB4_BYTE ||
@@ -132,6 +130,8 @@ static void start_frame(AVFilterLink *li
     AVFilterLink *outlink = link->dst->outputs[0];
     AVFilterPicRef *outpicref;
 
+    avcodec_get_chroma_sub_sample(link->format, &scale->hsub, &scale->vsub);
+
     outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
     outpicref->pts = picref->pts;
     outlink->outpic = outpicref;



More information about the ffmpeg-cvslog mailing list