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/mxpegdec.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/mxpegdec.c')
-rw-r--r-- | libavcodec/mxpegdec.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c index 5b72d42447..0069ca5885 100644 --- a/libavcodec/mxpegdec.c +++ b/libavcodec/mxpegdec.c @@ -248,11 +248,9 @@ static int mxpeg_decode_frame(AVCodecContext *avctx, } /* use stored SOF data to allocate current picture */ av_frame_unref(jpg->picture_ptr); - if (ff_get_buffer(avctx, jpg->picture_ptr, - AV_GET_BUFFER_FLAG_REF) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return AVERROR(ENOMEM); - } + if ((ret = ff_get_buffer(avctx, jpg->picture_ptr, + AV_GET_BUFFER_FLAG_REF)) < 0) + return ret; jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_P; jpg->picture_ptr->key_frame = 0; jpg->got_picture = 1; @@ -268,11 +266,9 @@ static int mxpeg_decode_frame(AVCodecContext *avctx, /* allocate dummy reference picture if needed */ if (!reference_ptr->data[0] && - ff_get_buffer(avctx, reference_ptr, - AV_GET_BUFFER_FLAG_REF) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return AVERROR(ENOMEM); - } + (ret = ff_get_buffer(avctx, reference_ptr, + AV_GET_BUFFER_FLAG_REF)) < 0) + return ret; ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr); if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) |