[FFmpeg-devel] [PATCH 2/6] sink_buffer: change get_buffer_ref error code to BUG.

Nicolas George nicolas.george at normalesup.org
Sun Mar 11 00:29:46 CET 2012


request_frame is supposed to either push a frame or
return a failure code; therefore, if it does neither
when asked to by av_buffersink_get_buffer_ref,
it is an internal bug in some filter that needs to be
fixed (AVERROR_BUG) and not a bug due to external
conditions (AVERROR(EINVAL)).

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/sink_buffer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/sink_buffer.c b/libavfilter/sink_buffer.c
index 926362b..cb089e9 100644
--- a/libavfilter/sink_buffer.c
+++ b/libavfilter/sink_buffer.c
@@ -131,7 +131,7 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
     }
 
     if (!av_fifo_size(buf->fifo))
-        return AVERROR(EINVAL);
+        return AVERROR_BUG;
 
     if (flags & AV_BUFFERSINK_FLAG_PEEK)
         *bufref = *((AVFilterBufferRef **)av_fifo_peek2(buf->fifo, 0));
-- 
1.7.9.1



More information about the ffmpeg-devel mailing list