Logo Search packages:      
Sourcecode: blender version File versions

void av_resample_compensate ( AVResampleContext *  c,
int  sample_delta,
int  compensation_distance 

Compensates samplerate/timestamp drift. The compensation is done by changing the resampler parameters, so no audible clicks or similar distortions ocur

compensation_distance distance in output samples over which the compensation should be performed
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

Definition at line 172 of file resample2.c.

Referenced by av_resample().

//    sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr;
    c->compensation_distance= compensation_distance;
    c->dst_incr = c->ideal_dst_incr - c->ideal_dst_incr * (int64_t)sample_delta / compensation_distance;

Generated by  Doxygen 1.6.0   Back to index