diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-22 18:54:38 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-22 20:37:12 +0200 |
commit | 841c1be57e59bc133cb615b48b0888ad9833156b (patch) | |
tree | dc0112c182eeaeaf172217b59402a7e95850be1e /libswresample/swresample.c | |
parent | d9b92980c9aa4ba1b533a59fe494f04c05ca1641 (diff) | |
download | ffmpeg-841c1be57e59bc133cb615b48b0888ad9833156b.tar.gz |
swr: check return value of swr_inject_silence/drop_output.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/swresample.c')
-rw-r--r-- | libswresample/swresample.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 732dae7092..a0560a19da 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -762,8 +762,12 @@ int64_t swr_next_pts(struct SwrContext *s, int64_t pts){ if(fabs(fdelta) > s->min_compensation) { if(!s->outpts || fabs(fdelta) > s->min_hard_compensation){ - if(delta > 0) swr_inject_silence(s, delta / s->out_sample_rate); - else swr_drop_output (s, -delta / s-> in_sample_rate); + int ret; + 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) { int duration = s->out_sample_rate * s->soft_compensation_duration; int comp = av_clipf(fdelta, -s->max_soft_compensation, s->max_soft_compensation) * duration ; |