diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-03-12 08:41:53 +0100 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-13 19:00:10 +0100 |
commit | 1ec94b0f066f14153d86395980a31b7466de3d9d (patch) | |
tree | b4c979679b299e9b457d026752173f7c084485ec /libavcodec/snow.c | |
parent | e7279638e8558d929465d2cc7c1d8ffe3cbf565d (diff) | |
download | ffmpeg-1ec94b0f066f14153d86395980a31b7466de3d9d.tar.gz |
lavc: factorize ff_{thread_,re,}get_buffer error messages.
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r-- | libavcodec/snow.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c index eea729716e..de19687a97 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -477,10 +477,9 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) { int ret, emu_buf_size; if(!s->scratchbuf) { - if ((ret = ff_get_buffer(s->avctx, &s->mconly_picture, AV_GET_BUFFER_FLAG_REF)) < 0) { - av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if ((ret = ff_get_buffer(s->avctx, &s->mconly_picture, + AV_GET_BUFFER_FLAG_REF)) < 0) return ret; - } FF_ALLOCZ_OR_GOTO(avctx, s->scratchbuf, FFMAX(s->mconly_picture.linesize[0], 2*avctx->width+256)*7*MB_SIZE, fail); emu_buf_size = FFMAX(s->mconly_picture.linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1); FF_ALLOC_OR_GOTO(avctx, s->emu_edge_buffer, emu_buf_size, fail); @@ -601,7 +600,7 @@ void ff_snow_release_buffer(AVCodecContext *avctx) int ff_snow_frame_start(SnowContext *s){ AVFrame tmp; - int i; + int i, ret; int w= s->avctx->width; //FIXME round up to x16 ? int h= s->avctx->height; @@ -642,10 +641,8 @@ int ff_snow_frame_start(SnowContext *s){ } } - if(ff_get_buffer(s->avctx, &s->current_picture, AV_GET_BUFFER_FLAG_REF) < 0){ - av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return -1; - } + if ((ret = ff_get_buffer(s->avctx, &s->current_picture, AV_GET_BUFFER_FLAG_REF)) < 0) + return ret; s->current_picture.key_frame= s->keyframe; |