diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-13 18:39:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-13 18:39:06 +0100 |
commit | d676598f879ba01ddb62f9abe8e17b2e94cb91cd (patch) | |
tree | afabebc63fd70fc3cd83bd59b2452d827c06fd8b /libswresample | |
parent | a34aee4646284eae67c1317d7baf82c2b3012aba (diff) | |
download | ffmpeg-d676598f879ba01ddb62f9abe8e17b2e94cb91cd.tar.gz |
swr: fix handling of timestamps that cause multiple drops or silence injections
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r-- | libswresample/swresample.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 19423024ba..ad33467e2a 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -873,7 +873,7 @@ int64_t swr_next_pts(struct SwrContext *s, int64_t pts){ if(s->min_compensation >= FLT_MAX) { return (s->outpts = pts - swr_get_delay(s, s->in_sample_rate * (int64_t)s->out_sample_rate)); } else { - int64_t delta = pts - swr_get_delay(s, s->in_sample_rate * (int64_t)s->out_sample_rate) - s->outpts; + int64_t delta = pts - swr_get_delay(s, s->in_sample_rate * (int64_t)s->out_sample_rate) - s->outpts + s->drop_output*(int64_t)s->in_sample_rate; double fdelta = delta /(double)(s->in_sample_rate * (int64_t)s->out_sample_rate); if(fabs(fdelta) > s->min_compensation) { |