[FFmpeg-devel] [PATCH] lavc: factorize {re, }get_buffer error message.
Clément Bœsch
ubitux at gmail.com
Tue Mar 12 10:31:11 CET 2013
On Tue, Mar 12, 2013 at 09:37:32AM +0100, Clément Bœsch wrote:
> 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;
And here is the second part, with the ff_thread_get_buffer() and manual
fixes for patterns not matched by the above profile.
This patch will be squashed with the previous one.
[...]
--
Clément B.
-------------- next part --------------
From a47cafe589e06f24ac4b7c622e7ae36d22486bcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Tue, 12 Mar 2013 10:01:03 +0100
Subject: [PATCH] lavc: factorize {re,}get_buffer error message PART II
---
libavcodec/ansi.c | 11 +++--------
libavcodec/bintext.c | 6 ++----
libavcodec/cdgraphics.c | 10 ++--------
libavcodec/crystalhd.c | 4 +---
libavcodec/dfa.c | 4 +---
libavcodec/diracdec.c | 8 +++-----
libavcodec/dnxhddec.c | 4 +---
libavcodec/dvdec.c | 8 +++-----
libavcodec/escape130.c | 6 ++----
libavcodec/exr.c | 4 +---
libavcodec/fraps.c | 4 +---
libavcodec/huffyuvdec.c | 4 +---
libavcodec/imc.c | 4 +---
libavcodec/indeo2.c | 4 +---
libavcodec/indeo3.c | 4 +---
libavcodec/lagarith.c | 16 ++++------------
libavcodec/libcelt_dec.c | 5 +----
libavcodec/libopenjpegdec.c | 4 +---
libavcodec/libopusdec.c | 5 +----
libavcodec/libstagefright.cpp | 1 -
libavcodec/mdec.c | 4 +---
libavcodec/mimic.c | 4 +---
libavcodec/mjpegdec.c | 4 +---
libavcodec/msvideo1.c | 4 +---
libavcodec/mvcdec.c | 5 +----
libavcodec/mxpegdec.c | 16 ++++++----------
libavcodec/nuv.c | 5 +----
libavcodec/pngdec.c | 4 +---
libavcodec/pthread.c | 10 +++++++++-
libavcodec/qtrle.c | 4 +---
libavcodec/rl2.c | 4 +---
libavcodec/roqvideoenc.c | 8 +++-----
libavcodec/sgidec.c | 6 ++----
libavcodec/sgirledec.c | 5 +----
libavcodec/smc.c | 4 +---
libavcodec/snow.c | 8 +++-----
libavcodec/tiertexseqv.c | 4 +---
libavcodec/truemotion1.c | 4 +---
libavcodec/utvideodec.c | 4 +---
libavcodec/vc1dec.c | 7 +++----
libavcodec/vmdav.c | 4 +---
libavcodec/vp3.c | 8 ++------
libavcodec/vp56.c | 6 ++----
libavcodec/vp8.c | 4 +---
libavcodec/vqavideo.c | 4 +---
libavcodec/wmaprodec.c | 1 -
libavcodec/wnv1.c | 1 -
libavcodec/xan.c | 4 +---
libavcodec/xxan.c | 4 +---
libavcodec/yop.c | 5 +----
50 files changed, 81 insertions(+), 190 deletions(-)
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index 621f095..f259852 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -246,11 +246,9 @@ static int execute_code(AVCodecContext * avctx, int c)
if (width != avctx->width || height != avctx->height) {
av_frame_unref(s->frame);
avcodec_set_dimensions(avctx, width, height);
- ret = ff_get_buffer(avctx, s->frame, AV_GET_BUFFER_FLAG_REF);
- if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, s->frame,
+ AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
- }
s->frame->pict_type = AV_PICTURE_TYPE_I;
s->frame->palette_has_changed = 1;
set_palette((uint32_t *)s->frame->data[1]);
@@ -351,11 +349,8 @@ static int decode_frame(AVCodecContext *avctx,
const uint8_t *buf_end = buf+buf_size;
int ret, i, count;
- ret = ff_reget_buffer(avctx, s->frame);
- if (ret < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;
- }
if (!avctx->frame_number) {
for (i=0; i<avctx->height; i++)
memset(s->frame->data[0]+ i*s->frame->linesize[0], 0, avctx->width);
diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c
index b6d7d0f..f8059aa 100644
--- a/libavcodec/bintext.c
+++ b/libavcodec/bintext.c
@@ -144,10 +144,8 @@ static int decode_frame(AVCodecContext *avctx,
int ret;
s->x = s->y = 0;
- if (ff_reget_buffer(avctx, s->frame) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
+ if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
+ return ret;
s->frame->pict_type = AV_PICTURE_TYPE_I;
s->frame->palette_has_changed = 1;
memcpy(s->frame->data[1], s->palette, 16 * 4);
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index f380dcd..d22e9f6 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -278,11 +278,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
- ret = ff_reget_buffer(avctx, cc->frame);
- if (ret) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0)
return ret;
- }
if (!avctx->frame_number) {
memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height);
memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
@@ -333,11 +330,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
- ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
- if (ret) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
- }
cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY);
av_frame_unref(cc->frame);
diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c
index 3e9b62b..94d3051 100644
--- a/libavcodec/crystalhd.c
+++ b/libavcodec/crystalhd.c
@@ -643,10 +643,8 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
priv->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
FF_BUFFER_HINTS_REUSABLE;
if (!priv->pic.data[0]) {
- if (ff_get_buffer(avctx, &priv->pic, 0) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if (ff_get_buffer(avctx, &priv->pic, 0) < 0)
return RET_ERROR;
- }
}
bwidth = av_image_get_linesize(avctx->pix_fmt, width, 0);
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index a2f18ae..b20cd0e 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -324,10 +324,8 @@ static int dfa_decode_frame(AVCodecContext *avctx,
int ret;
int i, pal_elems;
- if ((ret = ff_get_buffer(avctx, frame, 0))) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
- }
bytestream2_init(&gb, avpkt->data, avpkt->size);
while (bytestream2_get_bytes_left(&gb) > 0) {
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index aa158bf..81d2b65 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1747,7 +1747,7 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
{
DiracContext *s = avctx->priv_data;
DiracFrame *pic = NULL;
- int i, parse_code = buf[4];
+ int ret, i, parse_code = buf[4];
unsigned tmp;
if (size < DATA_UNIT_HEADER_SIZE)
@@ -1811,10 +1811,8 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
pic->avframe.key_frame = s->num_refs == 0; /* [DIRAC_STD] is_intra() */
pic->avframe.pict_type = s->num_refs + 1; /* Definition of AVPictureType in avutil.h */
- if (ff_get_buffer(avctx, &pic->avframe, (parse_code & 0x0C) == 0x0C ? AV_GET_BUFFER_FLAG_REF : 0) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
+ if ((ret = ff_get_buffer(avctx, &pic->avframe, (parse_code & 0x0C) == 0x0C ? AV_GET_BUFFER_FLAG_REF : 0)) < 0)
+ return ret;
s->current_picture = pic;
s->plane[0].stride = pic->avframe.linesize[0];
s->plane[1].stride = pic->avframe.linesize[1];
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 1992119..11bed00 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -385,10 +385,8 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
avcodec_set_dimensions(avctx, ctx->width, ctx->height);
if (first_field) {
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
picture->pict_type = AV_PICTURE_TYPE_I;
picture->key_frame = 1;
}
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 51e32b5..5cc205c 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -319,7 +319,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
int buf_size = avpkt->size;
DVVideoContext *s = avctx->priv_data;
const uint8_t* vsc_pack;
- int apt, is16_9;
+ int ret, apt, is16_9;
s->sys = avpriv_dv_frame_profile2(avctx, s->sys, buf, buf_size);
if (!s->sys || buf_size < s->sys->frame_size || ff_dv_init_dynamic_tables(s->sys)) {
@@ -332,10 +332,8 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
avctx->pix_fmt = s->sys->pix_fmt;
avctx->time_base = s->sys->time_base;
avcodec_set_dimensions(avctx, s->sys->width, s->sys->height);
- if (ff_get_buffer(avctx, &s->picture, 0) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
+ if ((ret = ff_get_buffer(avctx, &s->picture, 0)) < 0)
+ return ret;
s->picture.interlaced_frame = 1;
s->picture.top_field_first = 0;
diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c
index 64d2383..d24af79 100644
--- a/libavcodec/escape130.c
+++ b/libavcodec/escape130.c
@@ -131,10 +131,8 @@ static int escape130_decode_frame(AVCodecContext *avctx,
// Header; no useful information in here
skip_bits_long(&gb, 128);
- if (ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
+ if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
+ return ret;
new_y = frame->data[0];
new_cb = frame->data[1];
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index cc0995c..1c2aa42 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -754,10 +754,8 @@ static int decode_frame(AVCodecContext *avctx,
memset(s->thread_data + prev_size, 0, s->thread_data_size - prev_size);
}
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
if (buf_end - buf < scan_line_blocks * 8)
return AVERROR_INVALIDDATA;
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index f80b41e..00a38c6 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -201,10 +201,8 @@ static int decode_frame(AVCodecContext *avctx,
avctx->pix_fmt = version & 1 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P;
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0))) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
switch (version) {
case 0:
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 8554ecf..e5a9e3b 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -523,10 +523,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer,
(const uint32_t*)buf, buf_size / 4);
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
if (s->context) {
table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size);
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 2d7dd63..bdeef04 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -948,10 +948,8 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
frame->nb_samples = COEFFS;
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
- }
for (i = 0; i < avctx->channels; i++) {
q->out_samples = (float *)frame->extended_data[i];
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 0ce65b1..f8e7415 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -149,10 +149,8 @@ static int ir2_decode_frame(AVCodecContext *avctx,
AVFrame * const p = &s->picture;
int start, ret;
- if ((ret = ff_reget_buffer(avctx, p)) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, p)) < 0)
return ret;
- }
start = 48; /* hardcoded for now */
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index fd302a7..29f2195 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -1088,10 +1088,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/* use BS_BUFFER flag for buffer switching */
ctx->buf_sel = (ctx->frame_flags >> BS_BUFFER) & 1;
- if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
- av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
return res;
- }
/* decode luma plane */
if ((res = decode_plane(ctx, avctx, ctx->planes, ctx->y_data_ptr, ctx->y_data_size, 40)))
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 200cbdc..8599784 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -539,10 +539,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
planes = 4;
}
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
dst = p->data[0];
if (frametype == FRAME_SOLID_RGBA) {
@@ -568,10 +566,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
if (frametype == FRAME_ARITH_RGB24 || frametype == FRAME_U_RGB24)
avctx->pix_fmt = AV_PIX_FMT_RGB24;
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
offs[0] = offset_bv;
offs[1] = offset_gu;
@@ -627,10 +623,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
case FRAME_ARITH_YUY2:
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
if (offset_ry >= buf_size ||
offset_gu >= buf_size ||
@@ -653,10 +647,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
case FRAME_ARITH_YV12:
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
if (buf_size <= offset_ry || buf_size <= offset_gu || buf_size <= offset_bv) {
return AVERROR_INVALIDDATA;
}
diff --git a/libavcodec/libcelt_dec.c b/libavcodec/libcelt_dec.c
index 496b95a..53bbb72 100644
--- a/libavcodec/libcelt_dec.c
+++ b/libavcodec/libcelt_dec.c
@@ -111,11 +111,8 @@ static int libcelt_dec_decode(AVCodecContext *c, void *data,
int16_t *pcm;
frame->nb_samples = c->frame_size;
- err = ff_get_buffer(c, frame, 0);
- if (err < 0) {
- av_log(c, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((err = ff_get_buffer(c, frame, 0)) < 0)
return err;
- }
pcm = (int16_t *)frame->data[0];
err = celt_decode(celt->dec, pkt->data, pkt->size, pcm, c->frame_size);
if (err < 0)
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 5476e0a..f8b6165 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -310,10 +310,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
if (image->comps[i].prec > avctx->bits_per_raw_sample)
avctx->bits_per_raw_sample = image->comps[i].prec;
- if (ff_thread_get_buffer(avctx, &frame, 0) < 0) {
- av_log(avctx, AV_LOG_ERROR, "ff_thread_get_buffer() failed\n");
+ if (ff_thread_get_buffer(avctx, &frame, 0) < 0)
goto done;
- }
ctx->dec_params.cp_limit_decoding = NO_LIMITATION;
ctx->dec_params.cp_reduce = avctx->lowres;
diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c
index 71078c4..9b5cfe7 100644
--- a/libavcodec/libopusdec.c
+++ b/libavcodec/libopusdec.c
@@ -132,11 +132,8 @@ static int libopus_decode(AVCodecContext *avc, void *data,
int ret, nb_samples;
frame->nb_samples = MAX_FRAME_SIZE;
- ret = ff_get_buffer(avc, frame, 0);
- if (ret < 0) {
- av_log(avc, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avc, frame, 0)) < 0)
return ret;
- }
if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp
index 4c270b0..a6fd1b9 100644
--- a/libavcodec/libstagefright.cpp
+++ b/libavcodec/libstagefright.cpp
@@ -187,7 +187,6 @@ void* decode_thread(void *arg)
}
ret = ff_get_buffer(avctx, frame->vframe);
if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
frame->status = ret;
decode_done = 1;
buffer->release();
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 561c2ed..8fb29ce 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -165,10 +165,8 @@ static int decode_frame(AVCodecContext *avctx,
ThreadFrame frame = { .f = data };
int i, ret;
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
frame.f->pict_type = AV_PICTURE_TYPE_I;
frame.f->key_frame = 1;
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 90e3969..db78751 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -402,10 +402,8 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data,
ctx->frames[ctx->cur_index].f->pict_type = is_pframe ? AV_PICTURE_TYPE_P :
AV_PICTURE_TYPE_I;
if ((res = ff_thread_get_buffer(avctx, &ctx->frames[ctx->cur_index],
- AV_GET_BUFFER_FLAG_REF)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ AV_GET_BUFFER_FLAG_REF)) < 0)
return res;
- }
ctx->next_prev_index = ctx->cur_index;
ctx->next_cur_index = (ctx->cur_index - 1) & 15;
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 2f75194..76d9e7e 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -442,10 +442,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
}
av_frame_unref(s->picture_ptr);
- if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
return -1;
- }
s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
s->picture_ptr->key_frame = 1;
s->got_picture = 1;
diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c
index afaa7ae..c5a1daa 100644
--- a/libavcodec/msvideo1.c
+++ b/libavcodec/msvideo1.c
@@ -298,10 +298,8 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
s->buf = buf;
s->size = buf_size;
- if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
return ret;
- }
if (s->mode_8bit) {
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
diff --git a/libavcodec/mvcdec.c b/libavcodec/mvcdec.c
index 7848d32..f7069e2 100644
--- a/libavcodec/mvcdec.c
+++ b/libavcodec/mvcdec.c
@@ -230,11 +230,8 @@ static int mvc_decode_frame(AVCodecContext *avctx,
GetByteContext gb;
int ret;
- ret = ff_reget_buffer(avctx, s->frame);
- if (ret < 0) {
- av_log (avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return AVERROR(ENOMEM);
- }
bytestream2_init(&gb, avpkt->data, avpkt->size);
if (avctx->codec_id == AV_CODEC_ID_MVC1)
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index 5b72d42..0069ca5 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))
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 48348ea..edf777e 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -246,11 +246,8 @@ retry:
init_frame = 1;
}
- result = ff_reget_buffer(avctx, &c->pic);
- if (result < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((result = ff_reget_buffer(avctx, &c->pic)) < 0)
return result;
- }
if (init_frame) {
memset(c->pic.data[0], 0, avctx->height * c->pic.linesize[0]);
memset(c->pic.data[1], 0x80, avctx->height * c->pic.linesize[1] / 2);
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 564baaf..086f3b41 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -637,10 +637,8 @@ static int decode_frame(AVCodecContext *avctx,
goto fail;
}
- if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0)
goto fail;
- }
p->pict_type = AV_PICTURE_TYPE_I;
p->key_frame = 1;
p->interlaced_frame = !!s->interlace_type;
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 5903e09..67592f4 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -940,7 +940,7 @@ int ff_thread_can_start_frame(AVCodecContext *avctx)
return 1;
}
-int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
+static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int flags)
{
PerThreadContext *p = avctx->thread_opaque;
int err;
@@ -1004,6 +1004,14 @@ int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
return err;
}
+int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
+{
+ int ret = thread_get_buffer_internal(avctx, f, flags);
+ if (ret < 0)
+ av_log(avctx, AV_LOG_ERROR, "thread_get_buffer() failed\n");
+ return ret;
+}
+
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
{
PerThreadContext *p = avctx->thread_opaque;
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 60b2029..c043249 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -412,10 +412,8 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
int ret;
bytestream2_init(&s->g, avpkt->data, avpkt->size);
- if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
- av_log (s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
return ret;
- }
/* check if this frame is even supposed to change */
if (avpkt->size < 8)
diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c
index 5a8064b..c8853de 100644
--- a/libavcodec/rl2.c
+++ b/libavcodec/rl2.c
@@ -181,10 +181,8 @@ static int rl2_decode_frame(AVCodecContext *avctx,
int ret, buf_size = avpkt->size;
Rl2Context *s = avctx->priv_data;
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
- }
/** run length decode */
rl2_rle_decode(s, buf, buf_size, frame->data[0], frame->linesize[0],
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 187b848..a652c47 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -1051,11 +1051,9 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (enc->first_frame) {
/* Alloc memory for the reconstruction data (we must know the stride
for that) */
- if (ff_get_buffer(avctx, enc->current_frame, 0) ||
- ff_get_buffer(avctx, enc->last_frame, 0)) {
- av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
- return -1;
- }
+ if ((ret = ff_get_buffer(avctx, enc->current_frame, 0)) < 0 ||
+ (ret = ff_get_buffer(avctx, enc->last_frame, 0)) < 0)
+ return ret;
/* Before the first video frame, write a "video info" chunk */
roq_write_video_info_chunk(enc);
diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
index 4b98daf..e7f453b 100644
--- a/libavcodec/sgidec.c
+++ b/libavcodec/sgidec.c
@@ -205,10 +205,8 @@ static int decode_frame(AVCodecContext *avctx,
return -1;
avcodec_set_dimensions(avctx, s->width, s->height);
- if (ff_get_buffer(avctx, p, 0) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");
- return -1;
- }
+ if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
+ return ret;
p->pict_type = AV_PICTURE_TYPE_I;
p->key_frame = 1;
diff --git a/libavcodec/sgirledec.c b/libavcodec/sgirledec.c
index 59f8e31..d49a957 100644
--- a/libavcodec/sgirledec.c
+++ b/libavcodec/sgirledec.c
@@ -115,11 +115,8 @@ static int sgirle_decode_frame(AVCodecContext *avctx,
SGIRLEContext *s = avctx->priv_data;
int ret;
- ret = ff_reget_buffer(avctx, s->frame);
- if (ret < 0) {
- av_log (avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;
- }
ret = decode_sgirle8(avctx, s->frame->data[0], avpkt->data, avpkt->size, avctx->width, avctx->height, s->frame->linesize[0]);
if (ret < 0)
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 52dce53..bb00c69 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -434,10 +434,8 @@ static int smc_decode_frame(AVCodecContext *avctx,
bytestream2_init(&s->gb, buf, buf_size);
- if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
return ret;
- }
if (pal) {
s->frame.palette_has_changed = 1;
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index c98b069..8704cf4 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -594,7 +594,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;
@@ -635,10 +635,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;
diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c
index 1c7e2e0..f892e4d 100644
--- a/libavcodec/tiertexseqv.c
+++ b/libavcodec/tiertexseqv.c
@@ -232,10 +232,8 @@ static int seqvideo_decode_frame(AVCodecContext *avctx,
SeqVideoContext *seq = avctx->priv_data;
- if ((ret = ff_reget_buffer(avctx, &seq->frame)) < 0) {
- av_log(seq->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, &seq->frame)) < 0)
return ret;
- }
if (seqvideo_decode(seq, buf, buf_size))
return AVERROR_INVALIDDATA;
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index a98897f..35fb2a3 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -868,10 +868,8 @@ static int truemotion1_decode_frame(AVCodecContext *avctx,
if ((ret = truemotion1_decode_header(s)) < 0)
return ret;
- if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
return ret;
- }
if (compression_types[s->compression].algorithm == ALGO_RGB24H) {
truemotion1_decode_24bit(s);
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 1bb2eb5..c098e44 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -333,10 +333,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
GetByteContext gb;
ThreadFrame frame = { .f = data };
- if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
- }
/* parse plane structure to get frame flags and validate slice offsets */
bytestream2_init(&gb, buf, buf_size);
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index aafc358..fd76c03 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5024,6 +5024,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
{
+ int ret;
MpegEncContext *s = &v->s;
AVCodecContext *avctx = s->avctx;
SpriteData sd;
@@ -5041,10 +5042,8 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
}
av_frame_unref(&v->sprite_output_frame);
- if (ff_get_buffer(avctx, &v->sprite_output_frame, 0) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
+ if ((ret = ff_get_buffer(avctx, &v->sprite_output_frame, 0)) < 0)
+ return ret;
vc1_draw_sprites(v, &sd);
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index c4081f8..7f7143b 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -425,10 +425,8 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx,
if (buf_size < 16)
return buf_size;
- if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
- }
vmd_decode(s, frame);
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index a77bf8f..9f7b5fa 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2024,10 +2024,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]));
@@ -2055,10 +2053,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;
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 00334d1..64ebdfb 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -524,10 +524,8 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
}
- if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
+ if ((res = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0)
+ return res;
if (s->has_alpha) {
av_frame_unref(s->alpha_context->frames[VP56_FRAME_CURRENT]);
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 9218dff..7bd1cc9 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1909,10 +1909,8 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
curframe->tf.f->key_frame = s->keyframe;
curframe->tf.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
- if ((ret = vp8_alloc_frame(s, curframe, referenced))) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed!\n");
+ if ((ret = vp8_alloc_frame(s, curframe, referenced)) < 0)
goto err;
- }
// check if golden and altref are swapped
if (s->update_altref != VP56_FRAME_NONE) {
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 6510582..a47e2db 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -598,10 +598,8 @@ static int vqa_decode_frame(AVCodecContext *avctx,
AVFrame *frame = data;
int res;
- if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
return res;
- }
bytestream2_init(&s->gb, avpkt->data, avpkt->size);
if ((res = vqa_decode_chunk(s, frame)) < 0)
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 08c1561..2a7507f 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1374,7 +1374,6 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
/* get output buffer */
frame->nb_samples = s->samples_per_frame;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
s->packet_loss = 1;
return 0;
}
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index dd72938..f7609af 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -82,7 +82,6 @@ static int decode_frame(AVCodecContext *avctx,
}
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
av_free(rbuf);
return ret;
}
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 3caa6c0..2ee2291 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -587,10 +587,8 @@ static int xan_decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
- if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF))) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
- }
if (!s->frame_size)
s->frame_size = frame->linesize[0] * s->avctx->height;
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
index 8df097b..ed98ce1 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -392,10 +392,8 @@ static int xan_decode_frame(AVCodecContext *avctx,
int ftype;
int ret;
- if ((ret = ff_reget_buffer(avctx, &s->pic))) {
- av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+ if ((ret = ff_reget_buffer(avctx, &s->pic)) < 0)
return ret;
- }
bytestream2_init(&s->gb, avpkt->data, avpkt->size);
ftype = bytestream2_get_le32(&s->gb);
diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index 092e84c..e1f5321 100644
--- a/libavcodec/yop.c
+++ b/libavcodec/yop.c
@@ -188,11 +188,8 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return AVERROR_INVALIDDATA;
}
- ret = ff_get_buffer(avctx, frame, 0);
- if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
- }
if (!avctx->frame_number)
memset(frame->data[1], 0, AVPALETTE_SIZE);
--
1.8.1.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130312/64d6cf34/attachment.asc>
More information about the ffmpeg-devel
mailing list