Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-09-05 00:01:38 +0400
committerAnton Khirnov <anton@khirnov.net>2012-09-07 11:06:48 +0400
commit91a84a5247857d18b211f45129cf39b6788f0022 (patch)
tree7c11c154f5c7e2e4919124de2316210c30525578 /libavfilter/af_asyncts.c
parent290d1022b2d90503735728d7feed35a53a69f631 (diff)
af_asyncts: check return value from lavr when flushing.
Fixes an infinite loop on flush when avresample_get_delay() still reports some samples but avresample_convert() doesn't return any data.
Diffstat (limited to 'libavfilter/af_asyncts.c')
-rw-r--r--libavfilter/af_asyncts.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c
index f5d2798b30..0b8be8d557 100644
--- a/libavfilter/af_asyncts.c
+++ b/libavfilter/af_asyncts.c
@@ -133,8 +133,13 @@ static int request_frame(AVFilterLink *link)
nb_samples);
if (!buf)
return AVERROR(ENOMEM);
- avresample_convert(s->avr, (void**)buf->extended_data, buf->linesize[0],
- nb_samples, NULL, 0, 0);
+ ret = avresample_convert(s->avr, (void**)buf->extended_data,
+ buf->linesize[0], nb_samples, NULL, 0, 0);
+ if (ret <= 0) {
+ avfilter_unref_bufferp(&buf);
+ return (ret < 0) ? ret : AVERROR_EOF;
+ }
+
buf->pts = s->pts;
return ff_filter_samples(link, buf);
}