diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-13 18:39:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-18 05:14:30 +0100 |
commit | 722bfe4e7c73d0c3550011a08b5e76df714e2b27 (patch) | |
tree | 6dba42bfda1999e5411f094f0e4853add75a2377 | |
parent | cc8ab9865650e7542f0340cd27762dbd8da52910 (diff) | |
download | ffmpeg-722bfe4e7c73d0c3550011a08b5e76df714e2b27.tar.gz |
swr: fix handling of timestamps that cause multiple drops or silence injections
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d676598f879ba01ddb62f9abe8e17b2e94cb91cd)
-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 f01927f293..f530c1f59e 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -826,7 +826,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) { |