avoid buf_size == 0 checks in every decoder
Originally committed as revision 3872 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
884182b383
commit
934982c4ac
@ -605,11 +605,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
AVFrame *p, temp;
|
AVFrame *p, temp;
|
||||||
int i, frame_4cc, frame_size;
|
int i, frame_4cc, frame_size;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
frame_4cc= get32(buf);
|
frame_4cc= get32(buf);
|
||||||
if(buf_size != get32(buf+4)+8){
|
if(buf_size != get32(buf+4)+8){
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "size missmatch %d %d\n", buf_size, get32(buf+4));
|
av_log(f->avctx, AV_LOG_ERROR, "size missmatch %d %d\n", buf_size, get32(buf+4));
|
||||||
|
@ -70,11 +70,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
|
|||||||
unsigned int planes = c->planes;
|
unsigned int planes = c->planes;
|
||||||
unsigned char *planemap = c->planemap;
|
unsigned char *planemap = c->planemap;
|
||||||
|
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(c->pic.data[0])
|
if(c->pic.data[0])
|
||||||
avctx->release_buffer(avctx, &c->pic);
|
avctx->release_buffer(avctx, &c->pic);
|
||||||
|
|
||||||
|
@ -409,11 +409,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
AVFrame * const p= (AVFrame*)&a->picture;
|
AVFrame * const p= (AVFrame*)&a->picture;
|
||||||
int mb_x, mb_y;
|
int mb_x, mb_y;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
|
||||||
|
@ -338,7 +338,10 @@ extern int motion_estimation_method;
|
|||||||
#define CODEC_CAP_TRUNCATED 0x0008
|
#define CODEC_CAP_TRUNCATED 0x0008
|
||||||
/* codec can export data for HW decoding (XvMC) */
|
/* codec can export data for HW decoding (XvMC) */
|
||||||
#define CODEC_CAP_HWACCEL 0x0010
|
#define CODEC_CAP_HWACCEL 0x0010
|
||||||
/** codec has a non zero delay and needs to be feeded with NULL at the end to get the delayed data */
|
/**
|
||||||
|
* codec has a non zero delay and needs to be feeded with NULL at the end to get the delayed data.
|
||||||
|
* if this is not set, the codec is guranteed to never be feeded with NULL data
|
||||||
|
*/
|
||||||
#define CODEC_CAP_DELAY 0x0020
|
#define CODEC_CAP_DELAY 0x0020
|
||||||
|
|
||||||
//the following defines might change, so dont expect compatibility if u use them
|
//the following defines might change, so dont expect compatibility if u use them
|
||||||
|
@ -43,11 +43,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
AVFrame * const p= (AVFrame*)&a->picture;
|
AVFrame * const p= (AVFrame*)&a->picture;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
|
||||||
|
@ -888,10 +888,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
DVVideoContext *s = avctx->priv_data;
|
DVVideoContext *s = avctx->priv_data;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if(buf_size==0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
s->sys = dv_frame_profile(buf);
|
s->sys = dv_frame_profile(buf);
|
||||||
if (!s->sys || buf_size < s->sys->frame_size)
|
if (!s->sys || buf_size < s->sys->frame_size)
|
||||||
return -1; /* NOTE: we only accept several full frames */
|
return -1; /* NOTE: we only accept several full frames */
|
||||||
|
@ -952,10 +952,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
|
|||||||
|
|
||||||
AVFrame *picture = data;
|
AVFrame *picture = data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ff_init_range_decoder(c, buf, buf_size);
|
ff_init_range_decoder(c, buf, buf_size);
|
||||||
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
|
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
|
||||||
|
|
||||||
|
@ -925,11 +925,6 @@ static int h261_decode_frame(AVCodecContext *avctx,
|
|||||||
s->flags= avctx->flags;
|
s->flags= avctx->flags;
|
||||||
s->flags2= avctx->flags2;
|
s->flags2= avctx->flags2;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h->gob_start_code_skipped=0;
|
h->gob_start_code_skipped=0;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
|
@ -793,7 +793,7 @@ AVCodec mpeg4_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
ff_h263_decode_end,
|
ff_h263_decode_end,
|
||||||
ff_h263_decode_frame,
|
ff_h263_decode_frame,
|
||||||
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED,
|
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
|
||||||
.options = mpeg4_decoptions,
|
.options = mpeg4_decoptions,
|
||||||
.flush= ff_mpeg_flush,
|
.flush= ff_mpeg_flush,
|
||||||
};
|
};
|
||||||
@ -807,7 +807,7 @@ AVCodec h263_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
ff_h263_decode_end,
|
ff_h263_decode_end,
|
||||||
ff_h263_decode_frame,
|
ff_h263_decode_frame,
|
||||||
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED,
|
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
|
||||||
.flush= ff_mpeg_flush,
|
.flush= ff_mpeg_flush,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6592,7 +6592,7 @@ AVCodec h264_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
decode_end,
|
decode_end,
|
||||||
decode_frame,
|
decode_frame,
|
||||||
/*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED,
|
/*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
|
||||||
};
|
};
|
||||||
|
|
||||||
AVCodecParser h264_parser = {
|
AVCodecParser h264_parser = {
|
||||||
|
@ -770,10 +770,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
|
|||||||
|
|
||||||
AVFrame *picture = data;
|
AVFrame *picture = data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
s->bitstream_buffer= av_fast_realloc(s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
s->bitstream_buffer= av_fast_realloc(s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
|
||||||
s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (uint32_t*)buf, buf_size/4);
|
s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (uint32_t*)buf, buf_size/4);
|
||||||
|
@ -1066,11 +1066,6 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
|
|||||||
unsigned char *src, *dest;
|
unsigned char *src, *dest;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
iv_decode_frame(s, buf, buf_size);
|
iv_decode_frame(s, buf, buf_size);
|
||||||
|
|
||||||
if(s->frame.data[0])
|
if(s->frame.data[0])
|
||||||
|
@ -214,10 +214,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
|
|||||||
#endif
|
#endif
|
||||||
unsigned int len = buf_size;
|
unsigned int len = buf_size;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(c->pic.data[0])
|
if(c->pic.data[0])
|
||||||
avctx->release_buffer(avctx, &c->pic);
|
avctx->release_buffer(avctx, &c->pic);
|
||||||
|
|
||||||
|
@ -163,11 +163,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
AVFrame * const p= (AVFrame*)&a->picture;
|
AVFrame * const p= (AVFrame*)&a->picture;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
|
||||||
|
@ -1826,10 +1826,6 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
|
|||||||
int start_code;
|
int start_code;
|
||||||
AVFrame *picture = data;
|
AVFrame *picture = data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
buf_ptr = buf;
|
buf_ptr = buf;
|
||||||
buf_end = buf + buf_size;
|
buf_end = buf + buf_size;
|
||||||
while (buf_ptr < buf_end) {
|
while (buf_ptr < buf_end) {
|
||||||
@ -2002,10 +1998,6 @@ static int mjpegb_decode_frame(AVCodecContext *avctx,
|
|||||||
uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
|
uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
|
||||||
uint32_t field_size, sod_offs;
|
uint32_t field_size, sod_offs;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
buf_ptr = buf;
|
buf_ptr = buf;
|
||||||
buf_end = buf + buf_size;
|
buf_end = buf + buf_size;
|
||||||
|
|
||||||
@ -2115,10 +2107,6 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
|
|||||||
uint8_t *buf_ptr, *buf_end, *recoded;
|
uint8_t *buf_ptr, *buf_end, *recoded;
|
||||||
int i = 0, j = 0;
|
int i = 0, j = 0;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!avctx->width || !avctx->height)
|
if (!avctx->width || !avctx->height)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -3100,7 +3100,7 @@ AVCodec mpeg1video_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
mpeg_decode_end,
|
mpeg_decode_end,
|
||||||
mpeg_decode_frame,
|
mpeg_decode_frame,
|
||||||
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED,
|
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
|
||||||
.flush= ff_mpeg_flush,
|
.flush= ff_mpeg_flush,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3113,7 +3113,7 @@ AVCodec mpeg2video_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
mpeg_decode_end,
|
mpeg_decode_end,
|
||||||
mpeg_decode_frame,
|
mpeg_decode_frame,
|
||||||
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED,
|
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
|
||||||
.flush= ff_mpeg_flush,
|
.flush= ff_mpeg_flush,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3127,7 +3127,7 @@ AVCodec mpegvideo_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
mpeg_decode_end,
|
mpeg_decode_end,
|
||||||
mpeg_decode_frame,
|
mpeg_decode_frame,
|
||||||
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED,
|
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
|
||||||
.flush= ff_mpeg_flush,
|
.flush= ff_mpeg_flush,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3190,7 +3190,7 @@ AVCodec mpeg_xvmc_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
mpeg_decode_end,
|
mpeg_decode_end,
|
||||||
mpeg_decode_frame,
|
mpeg_decode_frame,
|
||||||
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED| CODEC_CAP_HWACCEL,
|
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED| CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
|
||||||
.flush= ff_mpeg_flush,
|
.flush= ff_mpeg_flush,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -254,10 +254,6 @@ static int msrle_decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
MsrleContext *s = (MsrleContext *)avctx->priv_data;
|
MsrleContext *s = (MsrleContext *)avctx->priv_data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
s->buf = buf;
|
s->buf = buf;
|
||||||
s->size = buf_size;
|
s->size = buf_size;
|
||||||
|
|
||||||
|
@ -302,10 +302,6 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
|
Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
s->buf = buf;
|
s->buf = buf;
|
||||||
s->size = buf_size;
|
s->size = buf_size;
|
||||||
|
|
||||||
|
@ -479,11 +479,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
uint32_t tag, length;
|
uint32_t tag, length;
|
||||||
int ret, crc;
|
int ret, crc;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
s->bytestream_start=
|
s->bytestream_start=
|
||||||
s->bytestream= buf;
|
s->bytestream= buf;
|
||||||
s->bytestream_end= buf + buf_size;
|
s->bytestream_end= buf + buf_size;
|
||||||
|
@ -165,11 +165,6 @@ static int pnm_decode_frame(AVCodecContext *avctx,
|
|||||||
int i, n, linesize, h;
|
int i, n, linesize, h;
|
||||||
unsigned char *ptr;
|
unsigned char *ptr;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
s->bytestream_start=
|
s->bytestream_start=
|
||||||
s->bytestream= buf;
|
s->bytestream= buf;
|
||||||
s->bytestream_end= buf + buf_size;
|
s->bytestream_end= buf + buf_size;
|
||||||
|
@ -42,11 +42,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
int colors;
|
int colors;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
|
||||||
|
@ -237,11 +237,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
uint8_t* outdata;
|
uint8_t* outdata;
|
||||||
int delta;
|
int delta;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
|
||||||
|
@ -530,10 +530,6 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
QtrleContext *s = (QtrleContext *)avctx->priv_data;
|
QtrleContext *s = (QtrleContext *)avctx->priv_data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
s->buf = buf;
|
s->buf = buf;
|
||||||
s->size = buf_size;
|
s->size = buf_size;
|
||||||
|
|
||||||
|
@ -248,10 +248,6 @@ static int rpza_decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
RpzaContext *s = (RpzaContext *)avctx->priv_data;
|
RpzaContext *s = (RpzaContext *)avctx->priv_data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
s->buf = buf;
|
s->buf = buf;
|
||||||
s->size = buf_size;
|
s->size = buf_size;
|
||||||
|
|
||||||
|
@ -763,7 +763,7 @@ AVCodec rv20_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
rv10_decode_end,
|
rv10_decode_end,
|
||||||
rv10_decode_frame,
|
rv10_decode_frame,
|
||||||
CODEC_CAP_DR1,
|
CODEC_CAP_DR1 | CODEC_CAP_DELAY,
|
||||||
.flush= ff_mpeg_flush,
|
.flush= ff_mpeg_flush,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -448,10 +448,6 @@ static int smc_decode_frame(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
SmcContext *s = (SmcContext *)avctx->priv_data;
|
SmcContext *s = (SmcContext *)avctx->priv_data;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
s->buf = buf;
|
s->buf = buf;
|
||||||
s->size = buf_size;
|
s->size = buf_size;
|
||||||
|
|
||||||
|
@ -2911,11 +2911,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
|
|||||||
int bytes_read;
|
int bytes_read;
|
||||||
AVFrame *picture = data;
|
AVFrame *picture = data;
|
||||||
int level, orientation, plane_index;
|
int level, orientation, plane_index;
|
||||||
|
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ff_init_range_decoder(c, buf, buf_size);
|
ff_init_range_decoder(c, buf, buf_size);
|
||||||
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
|
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
|
||||||
|
@ -713,10 +713,6 @@ static int svq1_decode_frame(AVCodecContext *avctx,
|
|||||||
int result, i, x, y, width, height;
|
int result, i, x, y, width, height;
|
||||||
AVFrame *pict = data;
|
AVFrame *pict = data;
|
||||||
|
|
||||||
if(buf==NULL && buf_size==0){
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* initialize bit buffer */
|
/* initialize bit buffer */
|
||||||
init_get_bits(&s->gb,buf,buf_size*8);
|
init_get_bits(&s->gb,buf,buf_size*8);
|
||||||
|
|
||||||
|
@ -1004,5 +1004,5 @@ AVCodec svq3_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
decode_end,
|
decode_end,
|
||||||
svq3_decode_frame,
|
svq3_decode_frame,
|
||||||
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
|
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
|
||||||
};
|
};
|
||||||
|
@ -873,10 +873,6 @@ static int truemotion1_decode_frame(AVCodecContext *avctx,
|
|||||||
s->buf = buf;
|
s->buf = buf;
|
||||||
s->size = buf_size;
|
s->size = buf_size;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (truemotion1_decode_header(s) == -1)
|
if (truemotion1_decode_header(s) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -155,10 +155,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
|
|||||||
#endif
|
#endif
|
||||||
int len = buf_size;
|
int len = buf_size;
|
||||||
|
|
||||||
/* no supplementary picture */
|
|
||||||
if (buf_size == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(c->pic.data[0])
|
if(c->pic.data[0])
|
||||||
avctx->release_buffer(avctx, &c->pic);
|
avctx->release_buffer(avctx, &c->pic);
|
||||||
|
|
||||||
|
@ -587,13 +587,17 @@ int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
|
|||||||
*got_picture_ptr= 0;
|
*got_picture_ptr= 0;
|
||||||
if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
|
if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
|
||||||
return -1;
|
return -1;
|
||||||
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
|
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
|
||||||
buf, buf_size);
|
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
|
||||||
|
buf, buf_size);
|
||||||
|
|
||||||
emms_c(); //needed to avoid a emms_c() call before every return;
|
emms_c(); //needed to avoid a emms_c() call before every return;
|
||||||
|
|
||||||
if (*got_picture_ptr)
|
if (*got_picture_ptr)
|
||||||
avctx->frame_number++;
|
avctx->frame_number++;
|
||||||
|
}else
|
||||||
|
ret= 0;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1705,7 +1705,7 @@ AVCodec vc9_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
vc9_decode_end,
|
vc9_decode_end,
|
||||||
vc9_decode_frame,
|
vc9_decode_frame,
|
||||||
0,
|
CODEC_CAP_DELAY,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1718,6 +1718,6 @@ AVCodec wmv3_decoder = {
|
|||||||
NULL,
|
NULL,
|
||||||
vc9_decode_end,
|
vc9_decode_end,
|
||||||
vc9_decode_frame,
|
vc9_decode_frame,
|
||||||
0,
|
CODEC_CAP_DELAY,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -45,11 +45,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
uint8_t *bytestream= buf;
|
uint8_t *bytestream= buf;
|
||||||
int i, x, y;
|
int i, x, y;
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
|
||||||
|
@ -48,12 +48,6 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
int stride;
|
int stride;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
int y0, y1, y2, y3, c0, c1;
|
int y0, y1, y2, y3, c0, c1;
|
||||||
|
|
||||||
|
|
||||||
/* special case for last picture */
|
|
||||||
if (buf_size == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p->data[0])
|
if(p->data[0])
|
||||||
avctx->release_buffer(avctx, p);
|
avctx->release_buffer(avctx, p);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user