mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 19:58:59 +00:00
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.
This commit is contained in:
parent
e7279638e8
commit
1ec94b0f06
@ -884,10 +884,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
// alternatively we would have to use our own buffer management
|
||||
avctx->flags |= CODEC_FLAG_EMU_EDGE;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, f->current_picture)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, f->current_picture)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (frame_4cc == AV_RL32("ifr2")) {
|
||||
f->current_picture->pict_type = AV_PICTURE_TYPE_I;
|
||||
@ -904,10 +902,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
} else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
|
||||
if (!f->last_picture->data[0]) {
|
||||
if ((ret = ff_get_buffer(avctx, f->last_picture,
|
||||
AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||
return ret;
|
||||
}
|
||||
for (i=0; i<avctx->height; i++)
|
||||
memset(f->last_picture->data[0] + i*f->last_picture->linesize[0], 0, 2*avctx->width);
|
||||
}
|
||||
|
@ -70,10 +70,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
unsigned char *planemap = c->planemap;
|
||||
int ret;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* Set data pointer after line lengths */
|
||||
dp = encoded + planes * (height << 1);
|
||||
|
@ -136,10 +136,8 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = buf_size * 2;
|
||||
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 (ch = 0; ch < avctx->channels; ch++) {
|
||||
delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
|
||||
|
@ -192,10 +192,8 @@ static int frame_configure_elements(AVCodecContext *avctx)
|
||||
/* get output buffer */
|
||||
av_frame_unref(ac->frame);
|
||||
ac->frame->nb_samples = 2048;
|
||||
if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* map output channel pointers to AVFrame data */
|
||||
for (ch = 0; ch < avctx->channels; ch++) {
|
||||
|
@ -91,10 +91,8 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
compr = AV_RL32(buf);
|
||||
buf += 4;
|
||||
|
@ -1375,10 +1375,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = s->num_blocks * 256;
|
||||
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;
|
||||
}
|
||||
|
||||
/* decode the audio blocks */
|
||||
channel_map = ff_ac3_dec_channel_map[s->output_mode & ~AC3_OUTPUT_LFEON][s->lfe_on];
|
||||
|
@ -637,10 +637,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = nb_samples;
|
||||
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;
|
||||
}
|
||||
samples = (short *)frame->data[0];
|
||||
samples_p = (int16_t **)frame->extended_data;
|
||||
|
||||
|
@ -142,10 +142,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = num_blocks * BLOCK_SAMPLES;
|
||||
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;
|
||||
}
|
||||
samples = (int16_t **)frame->extended_data;
|
||||
samples_offset = 0;
|
||||
|
||||
|
@ -289,10 +289,8 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
if (!alac->nb_samples) {
|
||||
/* get output buffer */
|
||||
frame->nb_samples = output_samples;
|
||||
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;
|
||||
}
|
||||
} else if (output_samples != alac->nb_samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %u != %d\n",
|
||||
output_samples, alac->nb_samples);
|
||||
|
@ -1480,10 +1480,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = ctx->cur_frame_length;
|
||||
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;
|
||||
}
|
||||
|
||||
// transform decoded frame into output format
|
||||
#define INTERLEAVE_OUTPUT(bps) \
|
||||
|
@ -963,10 +963,8 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = AMR_BLOCK_SIZE;
|
||||
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;
|
||||
}
|
||||
buf_out = (float *)frame->data[0];
|
||||
|
||||
p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
|
||||
|
@ -1112,10 +1112,8 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = 4 * AMRWB_SFR_SIZE_16k;
|
||||
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;
|
||||
}
|
||||
buf_out = (float *)frame->data[0];
|
||||
|
||||
header_size = decode_mime_header(ctx, buf);
|
||||
|
@ -117,10 +117,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
uint8_t *dst, *dst_end;
|
||||
int count, ret;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0){
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
dst = s->frame->data[0];
|
||||
dst_end = s->frame->data[0] + s->frame->linesize[0]*avctx->height;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -904,10 +904,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = blockstodecode;
|
||||
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;
|
||||
}
|
||||
|
||||
s->error=0;
|
||||
|
||||
|
@ -210,10 +210,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
AVFrame * const p = data;
|
||||
int mb_x, mb_y, ret;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
p->pict_type = AV_PICTURE_TYPE_I;
|
||||
p->key_frame = 1;
|
||||
|
||||
|
@ -287,10 +287,8 @@ static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = AT1_SU_SAMPLES;
|
||||
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 (ch = 0; ch < avctx->channels; ch++) {
|
||||
AT1SUCtx* su = &q->SUs[ch];
|
||||
|
@ -813,10 +813,8 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = SAMPLES_PER_FRAME;
|
||||
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;
|
||||
}
|
||||
|
||||
/* Check if we need to descramble and what buffer to pass on. */
|
||||
if (q->scrambled_stream) {
|
||||
|
@ -59,10 +59,8 @@ static int aura_decode_frame(AVCodecContext *avctx,
|
||||
/* pixel data starts 48 bytes in, after 3x16-byte tables */
|
||||
buf += 48;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Y = frame->data[0];
|
||||
U = frame->data[1];
|
||||
|
@ -93,10 +93,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if((ret = ff_get_buffer(avctx, p, 0)) < 0){
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
p->pict_type= AV_PICTURE_TYPE_I;
|
||||
p->key_frame= 1;
|
||||
|
||||
|
@ -60,10 +60,8 @@ avs_decode_frame(AVCodecContext * avctx,
|
||||
AvsBlockType type;
|
||||
GetBitContext change_map = {0}; //init to silence warning
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, p)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, p)) < 0)
|
||||
return ret;
|
||||
}
|
||||
p->pict_type = AV_PICTURE_TYPE_P;
|
||||
p->key_frame = 0;
|
||||
|
||||
|
@ -33,6 +33,7 @@ static av_cold int avui_decode_init(AVCodecContext *avctx)
|
||||
static int avui_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame, AVPacket *avpkt)
|
||||
{
|
||||
int ret;
|
||||
AVFrame *pic = data;
|
||||
const uint8_t *src = avpkt->data, *extradata = avctx->extradata;
|
||||
const uint8_t *srca;
|
||||
@ -67,10 +68,8 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data,
|
||||
avpkt->size >= opaque_length * 2 + 4;
|
||||
srca = src + opaque_length + 5;
|
||||
|
||||
if (ff_get_buffer(avctx, pic, 0) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
pic->key_frame = 1;
|
||||
pic->pict_type = AV_PICTURE_TYPE_I;
|
||||
|
@ -75,10 +75,8 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
|
||||
int code, ret;
|
||||
int yoffset;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, &vid->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, &vid->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
wrap_to_next_line = vid->frame.linesize[0] - avctx->width;
|
||||
|
||||
if (avpkt->side_data_elems > 0 &&
|
||||
|
@ -58,10 +58,8 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
|
||||
uint32_t *pal;
|
||||
int i, j, ret, height = avctx->height;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
bytestream2_init(&g, avpkt->data, buf_size);
|
||||
|
||||
|
@ -1186,15 +1186,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
int bits_count = pkt->size << 3;
|
||||
|
||||
if (c->version > 'b') {
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
if ((ret = ff_reget_buffer(avctx, c->last)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, c->last)) < 0)
|
||||
return ret;
|
||||
}
|
||||
if ((ret = av_frame_ref(frame, c->last)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
@ -318,10 +318,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = s->frame_len;
|
||||
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;
|
||||
}
|
||||
|
||||
if (decode_block(s, (float **)frame->extended_data,
|
||||
avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT)) {
|
||||
|
@ -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);
|
||||
|
@ -196,10 +196,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
p->pict_type = AV_PICTURE_TYPE_I;
|
||||
p->key_frame = 1;
|
||||
|
||||
|
@ -242,10 +242,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
scr_off = 0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (decode_bmv_frame(c->stream, pkt->size - (c->stream - pkt->data), c->frame, scr_off)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error decoding frame data\n");
|
||||
@ -320,10 +318,8 @@ static int bmv_aud_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = total_blocks * 32;
|
||||
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;
|
||||
}
|
||||
output_samples = (int16_t *)frame->data[0];
|
||||
|
||||
for (blocks = 0; blocks < total_blocks; blocks++) {
|
||||
|
@ -134,10 +134,8 @@ static int brpix_decode_frame(AVCodecContext *avctx,
|
||||
if (hdr.width != avctx->width || hdr.height != avctx->height)
|
||||
avcodec_set_dimensions(avctx, hdr.width, hdr.height);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
chunk_type = bytestream2_get_be32(&gb);
|
||||
|
||||
|
@ -129,10 +129,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
c93->currentpic ^= 1;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, newpic)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, newpic)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
stride = newpic->linesize[0];
|
||||
|
||||
|
@ -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);
|
||||
|
@ -260,10 +260,8 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
p->pict_type = AV_PICTURE_TYPE_I;
|
||||
|
||||
if (encoding) {
|
||||
|
@ -439,10 +439,8 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
|
||||
s->data = buf;
|
||||
s->size = buf_size;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (s->palette_video) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
@ -52,10 +52,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
p->pict_type = AV_PICTURE_TYPE_I;
|
||||
p->key_frame = 1;
|
||||
|
||||
|
@ -329,11 +329,8 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB24;
|
||||
avctx->bits_per_raw_sample = 8;
|
||||
|
||||
ret = ff_get_buffer(avctx, pic, 0);
|
||||
if (ret < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = decode_rgb24_frame(ctx, &gb, pic);
|
||||
if (ret < 0)
|
||||
@ -344,11 +341,8 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
avctx->pix_fmt = AV_PIX_FMT_ARGB;
|
||||
avctx->bits_per_raw_sample = 8;
|
||||
|
||||
ret = ff_get_buffer(avctx, pic, 0);
|
||||
if (ret < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = decode_argb_frame(ctx, &gb, pic);
|
||||
if (ret < 0)
|
||||
|
@ -142,10 +142,8 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
|
||||
p->excitation, avctx->frame_size, p->order);
|
||||
|
||||
frame->nb_samples = avctx->frame_size;
|
||||
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;
|
||||
}
|
||||
buf_out = (int16_t *)frame->data[0];
|
||||
for (i = 0; i < avctx->frame_size; i++)
|
||||
buf_out[i] = p->filter_out[i + p->order];
|
||||
|
@ -970,10 +970,8 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
|
||||
/* get output buffer */
|
||||
if (q->discarded_packets >= 2) {
|
||||
frame->nb_samples = q->samples_per_channel;
|
||||
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;
|
||||
}
|
||||
samples = (float **)frame->extended_data;
|
||||
}
|
||||
|
||||
|
@ -100,10 +100,8 @@ static int cpia_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
// Get buffer filled with previous frame
|
||||
if ((ret = ff_reget_buffer(avctx, frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed!\n");
|
||||
if ((ret = ff_reget_buffer(avctx, frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
for ( i = 0;
|
||||
|
@ -642,10 +642,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, AV_GET_BUFFER_FLAG_REF) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if (ff_get_buffer(avctx, priv->pic, AV_GET_BUFFER_FLAG_REF) < 0)
|
||||
return RET_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
bwidth = av_image_get_linesize(avctx->pix_fmt, width, 0);
|
||||
|
@ -74,10 +74,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// decompress data
|
||||
switch ((buf[0] >> 1) & 7) {
|
||||
|
@ -105,10 +105,8 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
|
||||
/* pixel data starts 48 bytes in, after 3x16-byte tables */
|
||||
stream_ptr = 48;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
y_plane = frame->data[0];
|
||||
u_plane = frame->data[1];
|
||||
|
@ -2355,10 +2355,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = 256 * (s->sample_blocks / 8);
|
||||
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;
|
||||
}
|
||||
samples_flt = (float **)frame->extended_data;
|
||||
|
||||
/* allocate buffer for extra channels if downmixing */
|
||||
|
@ -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) {
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -211,10 +211,8 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = (out + avctx->channels - 1) / avctx->channels;
|
||||
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;
|
||||
}
|
||||
output_samples = (int16_t *)frame->data[0];
|
||||
samples_end = output_samples + out;
|
||||
|
||||
|
@ -179,10 +179,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Move pointer to offset from start of file
|
||||
buf = avpkt->data + offset;
|
||||
|
@ -305,10 +305,8 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
|
||||
break;
|
||||
}
|
||||
|
||||
if ((res = ff_reget_buffer(avctx, &cin->frame)) < 0) {
|
||||
av_log(cin->avctx, AV_LOG_ERROR, "failed to allocate a frame\n");
|
||||
if ((res = ff_reget_buffer(avctx, &cin->frame)) < 0)
|
||||
return res;
|
||||
}
|
||||
|
||||
memcpy(cin->frame.data[1], cin->palette, sizeof(cin->palette));
|
||||
cin->frame.palette_has_changed = 1;
|
||||
@ -363,10 +361,8 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = avpkt->size - cin->initial_decode_frame;
|
||||
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;
|
||||
}
|
||||
samples = (int16_t *)frame->data[0];
|
||||
|
||||
delta = cin->delta;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -212,10 +212,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
pc = 1;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
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;
|
||||
}
|
||||
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||
frame->palette_has_changed = pc;
|
||||
|
||||
|
@ -188,10 +188,8 @@ static int cmv_decode_frame(AVCodecContext *avctx,
|
||||
if (av_image_check_size(s->width, s->height, 0, s->avctx))
|
||||
return -1;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
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;
|
||||
}
|
||||
|
||||
memcpy(frame->data[1], s->palette, AVPALETTE_SIZE);
|
||||
|
||||
|
@ -266,10 +266,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
av_frame_unref(&s->last_frame);
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (inter && !s->last_frame.data[0]) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Missing reference frame.\n");
|
||||
|
@ -225,10 +225,8 @@ static int tgq_decode_frame(AVCodecContext *avctx,
|
||||
tgq_calculate_qtable(s, bytestream2_get_byteu(&s->gb));
|
||||
bytestream2_skip(&s->gb, 3);
|
||||
|
||||
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;
|
||||
}
|
||||
frame->key_frame = 1;
|
||||
frame->pict_type = AV_PICTURE_TYPE_I;
|
||||
|
||||
|
@ -114,10 +114,8 @@ static int tqi_decode_frame(AVCodecContext *avctx,
|
||||
if (s->avctx->width!=s->width || s->avctx->height!=s->height)
|
||||
avcodec_set_dimensions(s->avctx, s->width, s->height);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
av_fast_padded_malloc(&t->bitstream_buf, &t->bitstream_buf_size,
|
||||
buf_end - buf);
|
||||
|
@ -271,10 +271,8 @@ static int escape124_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
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;
|
||||
}
|
||||
|
||||
new_frame_data = (uint16_t*)frame->data[0];
|
||||
new_stride = frame->linesize[0] / 2;
|
||||
|
@ -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];
|
||||
|
@ -755,10 +755,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;
|
||||
|
@ -758,10 +758,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
p->key_frame = 0;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (avctx->debug & FF_DEBUG_PICT_INFO)
|
||||
av_log(avctx, AV_LOG_DEBUG, "ver:%d keyframe:%d coder:%d ec:%d slices:%d bps:%d\n",
|
||||
|
@ -545,10 +545,8 @@ static int flac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = s->blocksize;
|
||||
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;
|
||||
}
|
||||
|
||||
s->dsp.decorrelate[s->ch_mode](frame->data, s->decoded, s->channels,
|
||||
s->blocksize, s->sample_shift);
|
||||
|
@ -337,10 +337,8 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
s->image_width, s->image_height, s->block_width, s->block_height,
|
||||
h_blocks, v_blocks, h_part, v_part);
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* loop over all block columns */
|
||||
for (j = 0; j < v_blocks + (v_part ? 1 : 0); j++) {
|
||||
|
@ -185,10 +185,8 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
|
||||
|
||||
bytestream2_init(&g2, buf, buf_size);
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
pixels = s->frame.data[0];
|
||||
pixel_limit = s->avctx->height * s->frame.linesize[0];
|
||||
@ -505,10 +503,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
|
||||
|
||||
bytestream2_init(&g2, buf, buf_size);
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
pixels = s->frame.data[0];
|
||||
pixel_limit = s->avctx->height * s->frame.linesize[0];
|
||||
|
@ -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:
|
||||
|
@ -59,10 +59,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
pic->pict_type = AV_PICTURE_TYPE_I;
|
||||
pic->key_frame = 1;
|
||||
|
@ -94,10 +94,8 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = avpkt->size * 2;
|
||||
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;
|
||||
}
|
||||
out_buf = (int16_t *)frame->data[0];
|
||||
|
||||
init_get_bits(&gb, avpkt->data, avpkt->size * 8);
|
||||
|
@ -1185,10 +1185,8 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
frame->nb_samples = FRAME_LEN;
|
||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
}
|
||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
out = (int16_t *)frame->data[0];
|
||||
|
||||
|
@ -431,10 +431,8 @@ static int g726_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = out_samples;
|
||||
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;
|
||||
}
|
||||
samples = (int16_t *)frame->data[0];
|
||||
|
||||
init_get_bits(&gb, buf, buf_size * 8);
|
||||
|
@ -420,10 +420,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
int is_periodic = 0; // whether one of the subframes is declared as periodic or not
|
||||
|
||||
ctx->frame.nb_samples = SUBFRAME_SIZE<<1;
|
||||
if ((ret = ff_get_buffer(avctx, &ctx->frame, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, &ctx->frame, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
out_frame = (int16_t*) ctx->frame.data[0];
|
||||
|
||||
if (buf_size == 10) {
|
||||
|
@ -469,10 +469,8 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
|
||||
avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);
|
||||
|
||||
av_frame_unref(s->frame);
|
||||
if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
av_fast_malloc(&s->idx_line, &s->idx_line_size, s->screen_width);
|
||||
if (!s->idx_line)
|
||||
@ -487,10 +485,8 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
s->frame->pict_type = AV_PICTURE_TYPE_P;
|
||||
s->frame->key_frame = 0;
|
||||
|
@ -70,10 +70,8 @@ static int gsm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = avctx->frame_size;
|
||||
if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
return res;
|
||||
}
|
||||
samples = (int16_t *)frame->data[0];
|
||||
|
||||
switch (avctx->codec_id) {
|
||||
|
@ -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);
|
||||
|
@ -222,10 +222,8 @@ static int idcin_decode_frame(AVCodecContext *avctx,
|
||||
s->buf = buf;
|
||||
s->size = buf_size;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (idcin_decode_vlcs(s, frame))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
@ -663,10 +663,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
|
||||
if ((res = extract_header(avctx, avpkt)) < 0)
|
||||
return res;
|
||||
if ((res = ff_reget_buffer(avctx, s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((res = ff_reget_buffer(avctx, s->frame)) < 0)
|
||||
return res;
|
||||
}
|
||||
if (!s->init && avctx->bits_per_coded_sample <= 8 &&
|
||||
avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
||||
if ((res = cmap_read_palette(avctx, (uint32_t*)s->frame->data[1])) < 0)
|
||||
|
@ -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];
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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)))
|
||||
|
@ -979,10 +979,8 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
bytestream2_init(&s->stream_ptr, buf + s->decoding_map_size,
|
||||
buf_size - s->decoding_map_size);
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (!s->is_16bpp) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
@ -905,10 +905,8 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
return buf_size;
|
||||
|
||||
avcodec_set_dimensions(avctx, ctx->planes[0].width, ctx->planes[0].height);
|
||||
if ((result = ff_get_buffer(avctx, frame, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((result = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
return result;
|
||||
}
|
||||
|
||||
if (ctx->is_scalable) {
|
||||
if (avctx->codec_id == AV_CODEC_ID_INDEO4)
|
||||
|
@ -151,10 +151,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (video_type == 0 || video_type == 1) {
|
||||
GetBitContext gb;
|
||||
|
@ -271,10 +271,8 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
|
||||
|
||||
bytestream2_init(&ctx->g, avpkt->data, avpkt->size);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
header = bytestream2_get_byte(&ctx->g);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -181,10 +181,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
unsigned int mthread_inlen, mthread_outlen;
|
||||
unsigned int len = buf_size;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
outptr = frame->data[0]; // Output image pointer
|
||||
|
||||
|
@ -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)
|
||||
|
@ -198,10 +198,8 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = avctx->frame_size;
|
||||
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;
|
||||
}
|
||||
samples = (int16_t *)frame->data[0];
|
||||
|
||||
for (i = 0; i < avctx->frame_size / GSM_FRAME_SIZE; i++) {
|
||||
|
@ -93,10 +93,8 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
frame->nb_samples = s->decoder.blockl;
|
||||
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;
|
||||
}
|
||||
|
||||
WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
|
||||
(const WebRtc_UWord16*) buf, &s->decoder, 1);
|
||||
|
@ -104,10 +104,8 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = 160;
|
||||
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;
|
||||
}
|
||||
|
||||
dec_mode = (buf[0] >> 3) & 0x000F;
|
||||
packet_size = block_size[dec_mode] + 1;
|
||||
@ -335,10 +333,8 @@ static int amr_wb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = 320;
|
||||
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;
|
||||
}
|
||||
|
||||
mode = (buf[0] >> 3) & 0x000F;
|
||||
packet_size = block_size[mode];
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -306,10 +306,10 @@ static int libschroedinger_decode_frame(AVCodecContext *avctx,
|
||||
framewithpts = ff_schro_queue_pop(&p_schro_params->dec_frame_queue);
|
||||
|
||||
if (framewithpts && framewithpts->frame) {
|
||||
if (ff_get_buffer(avctx, avframe, 0) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unable to allocate buffer\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
int ret;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, avframe, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
memcpy(avframe->data[0],
|
||||
framewithpts->frame->components[0].data,
|
||||
|
@ -118,10 +118,8 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = s->frame_size;
|
||||
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;
|
||||
}
|
||||
output = (int16_t *)frame->data[0];
|
||||
|
||||
/* if there is not enough data left for the smallest possible frame or the
|
||||
|
@ -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();
|
||||
|
@ -143,10 +143,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
|
||||
}
|
||||
|
||||
frame->nb_samples = 8192*4;
|
||||
if ((ret = ff_get_buffer(avccontext, frame, 0)) < 0) {
|
||||
av_log(avccontext, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avccontext, frame, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
output = (int16_t *)frame->data[0];
|
||||
|
||||
|
||||
|
@ -178,10 +178,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
AVFrame * const p = data;
|
||||
int decoded, ret;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
p->key_frame = 1;
|
||||
|
||||
#define ADVANCE_BY_DECODED do { \
|
||||
|
@ -246,10 +246,8 @@ static int mace_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = 3 * (buf_size << (1 - is_mace3)) / avctx->channels;
|
||||
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;
|
||||
}
|
||||
samples = (int16_t **)frame->extended_data;
|
||||
|
||||
for(i = 0; i < avctx->channels; i++) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -405,10 +405,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;
|
||||
|
@ -443,10 +443,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;
|
||||
|
@ -1023,10 +1023,8 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = s->blockpos;
|
||||
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;
|
||||
}
|
||||
data_32 = (int32_t *)frame->data[0];
|
||||
data_16 = (int16_t *)frame->data[0];
|
||||
|
||||
|
@ -188,10 +188,8 @@ static int mm_decode_frame(AVCodecContext *avctx,
|
||||
buf_size -= MM_PREAMBLE_SIZE;
|
||||
bytestream2_init(&s->gb, buf, buf_size);
|
||||
|
||||
if ((res = ff_reget_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((res = ff_reget_buffer(avctx, &s->frame)) < 0)
|
||||
return res;
|
||||
}
|
||||
|
||||
switch(type) {
|
||||
case MM_TYPE_PALETTE : res = mm_decode_pal(s); return avpkt->size;
|
||||
|
@ -265,10 +265,8 @@ static int mp_decode_frame(AVCodecContext *avctx,
|
||||
GetBitContext gb;
|
||||
int i, count1, count2, sz, ret;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, &mp->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
if ((ret = ff_reget_buffer(avctx, &mp->frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* le32 bitstream msb first */
|
||||
av_fast_malloc(&mp->bswapbuf, &mp->bswapbuf_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user