On 09/04/2012 04:21 PM, Anton Khirnov wrote:
> Fixes an infinite loop on flush when avresample_get_delay() still
> reports some samples but avresample_convert() doesn't return any data.
> ---
> libavfilter/af_asyncts.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/af_asyncts.c b/libavfilter/af_asyncts.c
> index 1f38232..f144d1f 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);
> }
LGTM
-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel