asyncts: use clipped delta value when setting resample compensation
authorJustin Ruggles <justin.ruggles@gmail.com>
Wed, 12 Dec 2012 18:26:57 +0000 (13:26 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Thu, 13 Dec 2012 18:02:21 +0000 (13:02 -0500)
The max_comp option is supposed to limit maximum compensation, but
currently the clipped value is not actually used.

libavfilter/af_asyncts.c

index 67f3c4f..087692e 100644 (file)
@@ -197,7 +197,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
         if (s->resample) {
             int comp = av_clip(delta, -s->max_comp, s->max_comp);
             av_log(ctx, AV_LOG_VERBOSE, "Compensating %d samples per second.\n", comp);
-            avresample_set_compensation(s->avr, delta, inlink->sample_rate);
+            avresample_set_compensation(s->avr, comp, inlink->sample_rate);
         }
         delta = 0;
     }