swr: fix handling of timestamps that cause multiple drops or silence injections
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a34aee4646
commit
d676598f87
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user