Commit 3013722c authored by Michael Niedermayer's avatar Michael Niedermayer

sink_buffer: assert that functions and sinks arent mixed

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fbf03ee3
...@@ -123,6 +123,8 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx, ...@@ -123,6 +123,8 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
int ret; int ret;
*bufref = NULL; *bufref = NULL;
av_assert0(!strcmp(ctx->filter->name, "buffersink") || !strcmp(ctx->filter->name, "abuffersink"));
/* no picref available, fetch it from the filterchain */ /* no picref available, fetch it from the filterchain */
if (!av_fifo_size(buf->fifo)) { if (!av_fifo_size(buf->fifo)) {
if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST) if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST)
...@@ -144,6 +146,8 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx, ...@@ -144,6 +146,8 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx) AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)
{ {
av_assert0(!strcmp(ctx->filter->name, "buffersink"));
return ctx->inputs[0]->frame_rate; return ctx->inputs[0]->frame_rate;
} }
...@@ -152,6 +156,8 @@ int av_buffersink_poll_frame(AVFilterContext *ctx) ...@@ -152,6 +156,8 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
BufferSinkContext *buf = ctx->priv; BufferSinkContext *buf = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0]; 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); return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment