|
|
@ -762,8 +762,12 @@ int64_t swr_next_pts(struct SwrContext *s, int64_t pts){ |
|
|
|
|
|
|
|
|
|
|
|
if(fabs(fdelta) > s->min_compensation) { |
|
|
|
if(fabs(fdelta) > s->min_compensation) { |
|
|
|
if(!s->outpts || fabs(fdelta) > s->min_hard_compensation){ |
|
|
|
if(!s->outpts || fabs(fdelta) > s->min_hard_compensation){ |
|
|
|
if(delta > 0) swr_inject_silence(s, delta / s->out_sample_rate); |
|
|
|
int ret; |
|
|
|
else swr_drop_output (s, -delta / s-> in_sample_rate); |
|
|
|
if(delta > 0) ret = swr_inject_silence(s, delta / s->out_sample_rate); |
|
|
|
|
|
|
|
else ret = swr_drop_output (s, -delta / s-> in_sample_rate); |
|
|
|
|
|
|
|
if(ret<0){ |
|
|
|
|
|
|
|
av_log(s, AV_LOG_ERROR, "Failed to compensate for timestamp delta of %f\n", fdelta); |
|
|
|
|
|
|
|
} |
|
|
|
} else if(s->soft_compensation_duration && s->max_soft_compensation) { |
|
|
|
} else if(s->soft_compensation_duration && s->max_soft_compensation) { |
|
|
|
int duration = s->out_sample_rate * s->soft_compensation_duration; |
|
|
|
int duration = s->out_sample_rate * s->soft_compensation_duration; |
|
|
|
int comp = av_clipf(fdelta, -s->max_soft_compensation, s->max_soft_compensation) * duration ; |
|
|
|
int comp = av_clipf(fdelta, -s->max_soft_compensation, s->max_soft_compensation) * duration ; |
|
|
|