diff mbox

[FFmpeg-devel,14/17] lavfi: disallow ff_request_frame for filters using activate.

Message ID 20161229143403.2851-14-george@nsup.org
State Accepted
Headers show

Commit Message

Nicolas George Dec. 29, 2016, 2:34 p.m. UTC
Having two different functions allows to have stricter tests
and detect errors earlier.

Signed-off-by: Nicolas George <george@nsup.org>
---
 libavfilter/avfilter.c | 1 +
 libavfilter/internal.h | 3 +++
 2 files changed, 4 insertions(+)


Unchanged.

Comments

Michael Niedermayer Dec. 31, 2016, 12:38 p.m. UTC | #1
On Thu, Dec 29, 2016 at 03:34:00PM +0100, Nicolas George wrote:
> Having two different functions allows to have stricter tests
> and detect errors earlier.
> 
> Signed-off-by: Nicolas George <george@nsup.org>
> ---
>  libavfilter/avfilter.c | 1 +
>  libavfilter/internal.h | 3 +++
>  2 files changed, 4 insertions(+)
> 
> 
> Unchanged.

LGTM

thx

[...]
diff mbox

Patch

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index d7677d5f23..680ecf8f95 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -407,6 +407,7 @@  int ff_request_frame(AVFilterLink *link)
 {
     FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, link, 1);
 
+    av_assert1(!link->dst->filter->activate);
     if (link->status_out)
         return link->status_out;
     if (link->status_in) {
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 8e9aadd40b..69048144f7 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -310,6 +310,9 @@  int ff_poll_frame(AVFilterLink *link);
 /**
  * Request an input frame from the filter at the other end of the link.
  *
+ * This function must not be used by filters using the activate callback,
+ * use ff_link_set_frame_wanted() instead.
+ *
  * The input filter may pass the request on to its inputs, fulfill the
  * request from an internal buffer or any other means specific to its function.
  *