]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_fade.c
Merge commit 'eccfb9778ae939764d17457f34338d140832d9e1'
[ffmpeg] / libavfilter / vf_fade.c
index cf77d8723c675d1fda087e111c2a24bc2beed998..c30c41db0da4a42a05dfdd98dba332fca21a8331 100644 (file)
@@ -300,7 +300,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     if (s->fade_state == VF_FADE_WAITING) {
         s->factor=0;
         if (frame_timestamp >= s->start_time/(double)AV_TIME_BASE
-            && inlink->frame_count >= s->start_frame) {
+            && inlink->frame_count_out >= s->start_frame) {
             // Time to start fading
             s->fade_state = VF_FADE_FADING;
 
@@ -311,15 +311,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 
             // Save start frame in case we are starting based on time and fading based on frames
             if (s->start_time != 0 && s->start_frame == 0) {
-                s->start_frame = inlink->frame_count;
+                s->start_frame = inlink->frame_count_out;
             }
         }
     }
     if (s->fade_state == VF_FADE_FADING) {
         if (s->duration == 0) {
             // Fading based on frame count
-            s->factor = (inlink->frame_count - s->start_frame) * s->fade_per_frame;
-            if (inlink->frame_count > s->start_frame + s->nb_frames) {
+            s->factor = (inlink->frame_count_out - s->start_frame) * s->fade_per_frame;
+            if (inlink->frame_count_out > s->start_frame + s->nb_frames) {
                 s->fade_state = VF_FADE_DONE;
             }
 
@@ -347,19 +347,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     if (s->factor < UINT16_MAX) {
         if (s->alpha) {
             ctx->internal->execute(ctx, filter_slice_alpha, frame, NULL,
-                                FFMIN(frame->height, ctx->graph->nb_threads));
+                                FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
         } else if (s->is_packed_rgb && !s->black_fade) {
             ctx->internal->execute(ctx, filter_slice_rgb, frame, NULL,
-                                   FFMIN(frame->height, ctx->graph->nb_threads));
+                                   FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
         } else {
             /* luma, or rgb plane in case of black */
             ctx->internal->execute(ctx, filter_slice_luma, frame, NULL,
-                                FFMIN(frame->height, ctx->graph->nb_threads));
+                                FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
 
             if (frame->data[1] && frame->data[2]) {
                 /* chroma planes */
                 ctx->internal->execute(ctx, filter_slice_chroma, frame, NULL,
-                                    FFMIN(frame->height, ctx->graph->nb_threads));
+                                    FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
             }
         }
     }