[FFmpeg-cvslog] sink_buffer: assert that functions and sinks arent mixed

Michael Niedermayer git at videolan.org
Sun Jun 24 14:48:39 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 24 14:17:14 2012 +0200| [3013722c137ccf56cdc8a7907ec668928af95d34] | committer: Michael Niedermayer

sink_buffer: assert that functions and sinks arent mixed

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3013722c137ccf56cdc8a7907ec668928af95d34
---

 libavfilter/sink_buffer.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavfilter/sink_buffer.c b/libavfilter/sink_buffer.c
index ad51639..c82bff0 100644
--- a/libavfilter/sink_buffer.c
+++ b/libavfilter/sink_buffer.c
@@ -123,6 +123,8 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
     int ret;
     *bufref = NULL;
 
+    av_assert0(!strcmp(ctx->filter->name, "buffersink") || !strcmp(ctx->filter->name, "abuffersink"));
+
     /* no picref available, fetch it from the filterchain */
     if (!av_fifo_size(buf->fifo)) {
         if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST)
@@ -144,6 +146,8 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
 
 AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)
 {
+    av_assert0(!strcmp(ctx->filter->name, "buffersink"));
+
     return ctx->inputs[0]->frame_rate;
 }
 
@@ -152,6 +156,8 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
     BufferSinkContext *buf = ctx->priv;
     AVFilterLink *inlink = ctx->inputs[0];
 
+    av_assert0(!strcmp(ctx->filter->name, "buffersink") || !strcmp(ctx->filter->name, "abuffersink"));
+
     return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink);
 }
 



More information about the ffmpeg-cvslog mailing list