Commit d676598f authored by Michael Niedermayer's avatar Michael Niedermayer

swr: fix handling of timestamps that cause multiple drops or silence injections

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a34aee46
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment