aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-19 22:42:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-19 22:42:32 +0200
commitd1384c00d4882712816612d82289be240c508779 (patch)
tree85b3ffce36ad3959daa2556b9153e427ae2b1ec7
parentc5371f775ca13cee114eea2d17e59af5a436a125 (diff)
downloadffmpeg-d1384c00d4882712816612d82289be240c508779.tar.gz
swr: skip soft compensation when its disabled.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswresample/swresample.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index dcc9a286c8..60706d3def 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -761,7 +761,7 @@ int64_t swr_next_pts(struct SwrContext *s, int64_t pts){
if(!s->outpts || fabs(fdelta) > s->min_hard_compensation){
if(delta > 0) swr_inject_silence(s, delta / s->out_sample_rate);
else swr_drop_output (s, -delta / s-> in_sample_rate);
- } else {
+ } else if(s->soft_compensation_duration && s->max_soft_compensation) {
int duration = s->out_sample_rate * s->soft_compensation_duration;
int comp = av_clipf(fdelta, -s->max_soft_compensation, s->max_soft_compensation) * duration ;
av_log(s, AV_LOG_VERBOSE, "compensating audio timestamp drift:%f compensation:%d in:%d\n", fdelta, comp, duration);