summaryrefslogtreecommitdiff
path: root/libavfilter/vf_alphamerge.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-03-13 09:56:58 +0100
committerClément Bœsch <ubitux@gmail.com>2013-03-13 19:00:09 +0100
commitf32fee570aa4c2d2bae5bc673f34b26eade4e382 (patch)
tree6054a983234406ef64b379223d91f2d215638957 /libavfilter/vf_alphamerge.c
parent05854f5505f5a8213024265f76e1f52244874be4 (diff)
lavfi/alphamerge: raise filter_frame() error.
Diffstat (limited to 'libavfilter/vf_alphamerge.c')
-rw-r--r--libavfilter/vf_alphamerge.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index 0727f7bfcc..644c7f47bb 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -131,12 +131,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
AVFilterContext *ctx = inlink->dst;
AlphaMergeContext *merge = ctx->priv;
+ int ret = 0;
int is_alpha = (inlink == ctx->inputs[1]);
struct FFBufQueue *queue =
(is_alpha ? &merge->queue_alpha : &merge->queue_main);
ff_bufqueue_add(ctx, queue, buf);
- while (1) {
+ do {
AVFrame *main_buf, *alpha_buf;
if (!ff_bufqueue_peek(&merge->queue_main, 0) ||
@@ -147,10 +148,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
merge->frame_requested = 0;
draw_frame(ctx, main_buf, alpha_buf);
- ff_filter_frame(ctx->outputs[0], main_buf);
+ ret = ff_filter_frame(ctx->outputs[0], main_buf);
av_frame_free(&alpha_buf);
- }
- return 0;
+ } while (ret >= 0);
+ return ret;
}
static int request_frame(AVFilterLink *outlink)