summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-03-12 08:41:53 +0100
committerClément Bœsch <ubitux@gmail.com>2013-03-13 19:00:10 +0100
commit1ec94b0f066f14153d86395980a31b7466de3d9d (patch)
treeb4c979679b299e9b457d026752173f7c084485ec /libavcodec/vp3.c
parente7279638e8558d929465d2cc7c1d8ffe3cbf565d (diff)
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/vp3.c')
-rw-r--r--libavcodec/vp3.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index f12b1b30bc..1e76786f37 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2028,10 +2028,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
s->current_frame.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
s->current_frame.f->key_frame = s->keyframe;
- if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0)
goto error;
- }
if (!s->edge_emu_buffer)
s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.f->linesize[0]));
@@ -2059,10 +2057,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
s->golden_frame.f->pict_type = AV_PICTURE_TYPE_I;
- if (ff_thread_get_buffer(avctx, &s->golden_frame, AV_GET_BUFFER_FLAG_REF) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if (ff_thread_get_buffer(avctx, &s->golden_frame, AV_GET_BUFFER_FLAG_REF) < 0)
goto error;
- }
ff_thread_release_buffer(avctx, &s->last_frame);
if ((ret = ff_thread_ref_frame(&s->last_frame, &s->golden_frame)) < 0)
goto error;