lavfi/atempo: remove dead increment.
[ffmpeg.git] / libavfilter / f_settb.c
index 9aed964..3430e70 100644 (file)
@@ -99,7 +99,7 @@ static int config_output_props(AVFilterLink *outlink)
     return 0;
 }
 
-static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
+static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
 {
     AVFilterContext *ctx = inlink->dst;
     AVFilterLink *outlink = ctx->outputs[0];
@@ -113,25 +113,23 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     }
     inlink->cur_buf = NULL;
 
-    ff_start_frame(outlink, picref);
+    return ff_start_frame(outlink, picref);
 }
 
-static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
+static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
 {
     AVFilterContext *ctx = inlink->dst;
     AVFilterLink *outlink = ctx->outputs[0];
-    AVFilterBufferRef *outsamples = insamples;
 
     if (av_cmp_q(inlink->time_base, outlink->time_base)) {
-        outsamples = avfilter_ref_buffer(insamples, ~0);
-        outsamples->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base);
+        int64_t orig_pts = samplesref->pts;
+        samplesref->pts = av_rescale_q(samplesref->pts, inlink->time_base, outlink->time_base);
         av_log(ctx, AV_LOG_DEBUG, "tb:%d/%d pts:%"PRId64" -> tb:%d/%d pts:%"PRId64"\n",
-               inlink ->time_base.num, inlink ->time_base.den, insamples ->pts,
-               outlink->time_base.num, outlink->time_base.den, outsamples->pts);
-        avfilter_unref_buffer(insamples);
+               inlink ->time_base.num, inlink ->time_base.den, orig_pts,
+               outlink->time_base.num, outlink->time_base.den, samplesref->pts);
     }
 
-    return ff_filter_samples(outlink, outsamples);
+    return ff_filter_samples(outlink, samplesref);
 }
 
 #if CONFIG_SETTB_FILTER