diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-08-19 21:26:58 +0400 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-08-22 21:04:30 +0400 |
commit | beeba9161a091d4d352e6fe5224c86c383f1aaa7 (patch) | |
tree | 66d196392f6052e5ee633f93d721fcb3e289ef77 /libavfilter/avfilter.c | |
parent | ac07f941ae1626bfd8e201a3771c67e54073e31e (diff) |
lavfi: add a closed field to AVFilerLink.
It will help forward errors and maintain consistency.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index b1df5373b3..861a57d400 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -159,6 +159,11 @@ void avfilter_link_free(AVFilterLink **link) av_freep(link); } +void avfilter_link_set_closed(AVFilterLink *link, int closed) +{ + link->closed = closed; +} + int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, unsigned filt_srcpad_idx, unsigned filt_dstpad_idx) { @@ -325,6 +330,8 @@ int ff_request_frame(AVFilterLink *link) int ret = -1; FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, link, 1); + if (link->closed) + return AVERROR_EOF; if (link->srcpad->request_frame) ret = link->srcpad->request_frame(link); else if (link->src->inputs[0]) @@ -335,6 +342,8 @@ int ff_request_frame(AVFilterLink *link) ff_filter_samples_framed(link, pbuf); return 0; } + if (ret == AVERROR_EOF) + link->closed = 1; return ret; } |