[FFmpeg-devel] [PATCH] vf_fade: fade always cal

Stefano Sabatini stefano.sabatini-lala at poste.it
Fri Mar 18 17:45:43 CET 2011


On date Friday 2011-03-18 15:25:26 +0000, Mark Himsley encoded:
> On 18/03/11 15:07, Mark Himsley wrote:
> >draw_slice() checks that the fade factor is < 65536 and only calculates
> >the fade if so. But the fade factor is clipped in end_frame() by
> >av_clip_uint16() to 65535, so the fade is calculated for every frame.
> >This patch alters the check so that it compares with < 65535 (UINT16_MAX).
> 
> And this time with the patch file attached...
> 
> -- 
> Mark
> 

> diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
> index 203a186..36f9bbc 100644
> --- a/libavfilter/vf_fade.c
> +++ b/libavfilter/vf_fade.c
> @@ -101,7 +101,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
>      uint8_t *p;
>      int i, j, plane;
>  
> -    if (fade->factor < 65536) {
> +    if (fade->factor < UINT16_MAX) {
>          /* luma or rgb plane */
>          for (i = 0; i < h; i++) {
>              p = outpic->data[0] + (y+i) * outpic->linesize[0];

OK, I had the same fix in my local repo and forgot to send the patch
for review.

I'll apply it soon, thanks.
-- 
FFmpeg = Fanciful and Fast Multimedia Proud Extroverse Gargoyle



More information about the ffmpeg-devel mailing list