[FFmpeg-cvslog] swr: fix handling of timestamps that cause multiple drops or silence injections
Michael Niedermayer
git at videolan.org
Sun Jan 20 04:39:52 CET 2013
ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 13 18:39:06 2013 +0100| [bca27b0480b605a300b79881475b34f05a48ed62] | committer: Michael Niedermayer
swr: fix handling of timestamps that cause multiple drops or silence injections
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d676598f879ba01ddb62f9abe8e17b2e94cb91cd)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bca27b0480b605a300b79881475b34f05a48ed62
---
libswresample/swresample.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 5d02aaf..b8c646f 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -770,7 +770,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) {
More information about the ffmpeg-cvslog
mailing list