avfilter/af_amerge: detect EOF immediately

Fix an infinite loop in forward_status_change().

Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Nicolas George 2016-12-22 12:04:12 +01:00 committed by Marton Balint
parent 8dcb28cf6d
commit 8156b5ac94

View File

@ -23,6 +23,9 @@
* Audio merging filter
*/
#define FF_INTERNAL_FIELDS 1
#include "framequeue.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
@ -182,7 +185,9 @@ static int request_frame(AVFilterLink *outlink)
int i, ret;
for (i = 0; i < s->nb_inputs; i++)
if (!s->in[i].nb_samples)
if (!s->in[i].nb_samples ||
/* detect EOF immediately */
(ctx->inputs[i]->status_in && !ctx->inputs[i]->status_out))
if ((ret = ff_request_frame(ctx->inputs[i])) < 0)
return ret;
return 0;