[FFmpeg-soc] [soc]: r5820 - libavfilter/vf_fade.c

bcoudurier subversion at mplayerhq.hu
Fri Jun 4 22:10:23 CEST 2010


Author: bcoudurier
Date: Fri Jun  4 22:10:23 2010
New Revision: 5820

Log:
Ensure fade-in ends at 65535, fade-out ends at 0, and keep fade factor between 0 - 65535

Modified:
   libavfilter/vf_fade.c

Modified: libavfilter/vf_fade.c
==============================================================================
--- libavfilter/vf_fade.c	Wed Jun  2 23:43:50 2010	(r5819)
+++ libavfilter/vf_fade.c	Fri Jun  4 22:10:23 2010	(r5820)
@@ -124,8 +124,9 @@ static void end_frame(AVFilterLink *link
     avfilter_unref_pic(link->cur_pic);
 
     if (fade->frame_index >= fade->start_frame &&
-        fade->frame_index < fade->stop_frame)
+        fade->frame_index <= fade->stop_frame)
         fade->factor += fade->fade_per_frame;
+    fade->factor = av_clip_uint16(fade->factor);
     fade->frame_index++;
 }
 
@@ -136,7 +137,7 @@ static void draw_slice(AVFilterLink *lin
     uint8_t *p;
     int i, j, plane;
 
-    if (fade->factor != 65536) {
+    if (fade->factor < 65536) {
         /* luma or rgb plane */
         for (i = 0; i < h; i++) {
             p = outpic->data[0] + (y+i) * outpic->linesize[0];


More information about the FFmpeg-soc mailing list