summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-30 03:32:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-30 04:38:32 +0200
commit16e25ef34b375dbc6789b6b0da7d077c1dcefe88 (patch)
treecd2b27d2a0c185192c1202f0aaa7979c760ed6a1 /libswresample
parentb0387edd5e766b1032f946d6cdb35b765bb45435 (diff)
parentc9cc76290f8139a012a12efe7e581276b8bd8dff (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: avconv: extend -r to work on any input stream. doc/avconv: expand documentation for the -s option. avconv: don't print filters inserted by avconv in stream mappings. avconv: merge configuration code for complex and simple filters avconv: split configuring input filters out of configure_complex_filter Conflicts: configure doc/ffmpeg.texi ffmpeg.c tests/ref/fate/idroq-video-encode Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/swresample.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 27f3581d5f..38bedf1e99 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -87,7 +87,7 @@ static const AVOption options[]={
{"comp_duration" , "Duration (in seconds) over which data is stretched/squeezeed to make it match the timestamps."
, OFFSET(soft_compensation_duration),AV_OPT_TYPE_FLOAT ,{.dbl=1 }, 0 , INT_MAX , PARAM },
{"max_soft_comp" , "Maximum factor by which data is stretched/squeezeed to make it match the timestamps."
- , OFFSET(max_soft_compensation),AV_OPT_TYPE_FLOAT ,{.dbl=0 }, 0 , INT_MAX , PARAM },
+ , OFFSET(max_soft_compensation),AV_OPT_TYPE_FLOAT ,{.dbl=0 }, INT_MIN, INT_MAX , PARAM },
{0}
};
@@ -771,7 +771,8 @@ int64_t swr_next_pts(struct SwrContext *s, int64_t pts){
}
} 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 ;
+ double max_soft_compensation = s->max_soft_compensation / (s->max_soft_compensation < 0 ? -s->in_sample_rate : 1);
+ int comp = av_clipf(fdelta, -max_soft_compensation, max_soft_compensation) * duration ;
av_log(s, AV_LOG_VERBOSE, "compensating audio timestamp drift:%f compensation:%d in:%d\n", fdelta, comp, duration);
swr_set_compensation(s, comp, duration);
}