AVFrame *p, temp;
int i, frame_4cc, frame_size;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
frame_4cc= get32(buf);
if(buf_size != get32(buf+4)+8){
av_log(f->avctx, AV_LOG_ERROR, "size missmatch %d %d\n", buf_size, get32(buf+4));
unsigned int planes = c->planes;
unsigned char *planemap = c->planemap;
-
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
if(c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
AVFrame * const p= (AVFrame*)&a->picture;
int mb_x, mb_y;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
if(p->data[0])
avctx->release_buffer(avctx, p);
#define CODEC_CAP_TRUNCATED 0x0008
/* codec can export data for HW decoding (XvMC) */
#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
//the following defines might change, so dont expect compatibility if u use them
AVFrame * const p= (AVFrame*)&a->picture;
int x, y;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
if(p->data[0])
avctx->release_buffer(avctx, p);
{
DVVideoContext *s = avctx->priv_data;
- /* special case for last picture */
- if(buf_size==0)
- return 0;
-
s->sys = dv_frame_profile(buf);
if (!s->sys || buf_size < s->sys->frame_size)
return -1; /* NOTE: we only accept several full frames */
AVFrame *picture = data;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
ff_init_range_decoder(c, buf, buf_size);
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
s->flags= avctx->flags;
s->flags2= avctx->flags2;
- /* no supplementary picture */
- if (buf_size == 0) {
- return 0;
- }
-
h->gob_start_code_skipped=0;
retry:
NULL,
ff_h263_decode_end,
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,
.flush= ff_mpeg_flush,
};
NULL,
ff_h263_decode_end,
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,
};
NULL,
decode_end,
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 = {
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->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (uint32_t*)buf, buf_size/4);
unsigned char *src, *dest;
int y;
- /* no supplementary picture */
- if (buf_size == 0) {
- return 0;
- }
-
iv_decode_frame(s, buf, buf_size);
if(s->frame.data[0])
#endif
unsigned int len = buf_size;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
if(c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
AVFrame * const p= (AVFrame*)&a->picture;
int i;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
if(p->data[0])
avctx->release_buffer(avctx, p);
int start_code;
AVFrame *picture = data;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
buf_ptr = buf;
buf_end = buf + buf_size;
while (buf_ptr < buf_end) {
uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
uint32_t field_size, sod_offs;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
buf_ptr = buf;
buf_end = buf + buf_size;
uint8_t *buf_ptr, *buf_end, *recoded;
int i = 0, j = 0;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
if (!avctx->width || !avctx->height)
return -1;
NULL,
mpeg_decode_end,
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,
};
NULL,
mpeg_decode_end,
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,
};
NULL,
mpeg_decode_end,
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,
};
NULL,
mpeg_decode_end,
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,
};
{
MsrleContext *s = (MsrleContext *)avctx->priv_data;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
s->buf = buf;
s->size = buf_size;
{
Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
s->buf = buf;
s->size = buf_size;
uint32_t tag, length;
int ret, crc;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
s->bytestream_start=
s->bytestream= buf;
s->bytestream_end= buf + buf_size;
int i, n, linesize, h;
unsigned char *ptr;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
s->bytestream_start=
s->bytestream= buf;
s->bytestream_end= buf + buf_size;
int colors;
int i;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
if(p->data[0])
avctx->release_buffer(avctx, p);
uint8_t* outdata;
int delta;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
if(p->data[0])
avctx->release_buffer(avctx, p);
{
QtrleContext *s = (QtrleContext *)avctx->priv_data;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
s->buf = buf;
s->size = buf_size;
{
RpzaContext *s = (RpzaContext *)avctx->priv_data;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
s->buf = buf;
s->size = buf_size;
NULL,
rv10_decode_end,
rv10_decode_frame,
- CODEC_CAP_DR1,
+ CODEC_CAP_DR1 | CODEC_CAP_DELAY,
.flush= ff_mpeg_flush,
};
{
SmcContext *s = (SmcContext *)avctx->priv_data;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
s->buf = buf;
s->size = buf_size;
int bytes_read;
AVFrame *picture = data;
int level, orientation, plane_index;
-
-
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
ff_init_range_decoder(c, buf, buf_size);
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
int result, i, x, y, width, height;
AVFrame *pict = data;
- if(buf==NULL && buf_size==0){
- return 0;
- }
-
/* initialize bit buffer */
init_get_bits(&s->gb,buf,buf_size*8);
NULL,
decode_end,
svq3_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
};
s->buf = buf;
s->size = buf_size;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
if (truemotion1_decode_header(s) == -1)
return -1;
#endif
int len = buf_size;
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
if(c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
*got_picture_ptr= 0;
if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
return -1;
- ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
- buf, buf_size);
+ if((avctx->codec->capabilities & CODEC_CAP_DELAY) || 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)
- avctx->frame_number++;
+ if (*got_picture_ptr)
+ avctx->frame_number++;
+ }else
+ ret= 0;
+
return ret;
}
NULL,
vc9_decode_end,
vc9_decode_frame,
- 0,
+ CODEC_CAP_DELAY,
NULL
};
NULL,
vc9_decode_end,
vc9_decode_frame,
- 0,
+ CODEC_CAP_DELAY,
NULL
};
uint8_t *bytestream= buf;
int i, x, y;
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
-
if(p->data[0])
avctx->release_buffer(avctx, p);
int stride;
uint32_t val;
int y0, y1, y2, y3, c0, c1;
-
-
- /* special case for last picture */
- if (buf_size == 0) {
- return 0;
- }
if(p->data[0])
avctx->release_buffer(avctx, p);