diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-11-12 02:05:26 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-11-12 02:05:26 +0000 |
commit | 788d7a8cacae917ff36310556f439006f253907f (patch) | |
tree | 31aa04429df5319ac8cc48e4290ea8bac44b8f52 /libavcodec/resample2.c | |
parent | 61c52ead7c5125824c8bd1e6b2811a66d1969376 (diff) | |
download | ffmpeg-788d7a8cacae917ff36310556f439006f253907f.tar.gz |
av_resample_compensate() doxy
Originally committed as revision 3671 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/resample2.c')
-rw-r--r-- | libavcodec/resample2.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c index c41f6e13a2..baa6a50864 100644 --- a/libavcodec/resample2.c +++ b/libavcodec/resample2.c @@ -159,6 +159,18 @@ void av_resample_close(AVResampleContext *c){ 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; |