# HG changeset patch # User michael # Date 1100225126 0 # Node ID 424e6b29de74e1fcab04e2608e3bb7ae489a6d94 # Parent ada3891b859d0fa47f427cddda1b9473e813a6cb av_resample_compensate() doxy diff -r ada3891b859d -r 424e6b29de74 resample2.c --- a/resample2.c Fri Nov 12 01:21:34 2004 +0000 +++ b/resample2.c Fri Nov 12 02:05:26 2004 +0000 @@ -159,6 +159,18 @@ av_freep(&c); } +/** + * Compensates samplerate/timestamp drift. The compensation is done by changing + * the resampler parameters, so no audible clicks or similar distortions ocur + * @param compensation_distance distance in output samples over which the compensation should be performed + * @param sample_delta number of output samples which should be output less + * + * example: av_resample_compensate(c, 10, 500) + * here instead of 510 samples only 500 samples would be output + * + * note, due to rounding the actual compensation might be slightly different, + * especially if the compensation_distance is large and the in_rate used during init is small + */ void av_resample_compensate(AVResampleContext *c, int sample_delta, int compensation_distance){ // sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr; c->compensation_distance= compensation_distance;