Browse Source

data_size = 0 cleanup

Originally committed as revision 3146 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 22 years ago
parent
commit
53db1cae1c
30 changed files with 2 additions and 57 deletions
  1. +0
    -2
      libavcodec/4xm.c
  2. +0
    -1
      libavcodec/a52dec.c
  3. +0
    -1
      libavcodec/ac3dec.c
  4. +0
    -2
      libavcodec/adpcm.c
  5. +0
    -3
      libavcodec/amr.c
  6. +0
    -2
      libavcodec/asv1.c
  7. +0
    -2
      libavcodec/cljr.c
  8. +0
    -2
      libavcodec/cyuv.c
  9. +0
    -1
      libavcodec/dv.c
  10. +0
    -2
      libavcodec/ffv1.c
  11. +0
    -2
      libavcodec/flac.c
  12. +0
    -2
      libavcodec/h263dec.c
  13. +0
    -2
      libavcodec/h264.c
  14. +0
    -2
      libavcodec/huffyuv.c
  15. +0
    -1
      libavcodec/indeo3.c
  16. +0
    -1
      libavcodec/mace.c
  17. +0
    -6
      libavcodec/mjpeg.c
  18. +0
    -2
      libavcodec/mpeg12.c
  19. +0
    -1
      libavcodec/mpegaudiodec.c
  20. +0
    -1
      libavcodec/oggvorbis.c
  21. +0
    -1
      libavcodec/raw.c
  22. +0
    -2
      libavcodec/roqvideo.c
  23. +0
    -3
      libavcodec/rv10.c
  24. +0
    -4
      libavcodec/svq1.c
  25. +0
    -2
      libavcodec/svq3.c
  26. +0
    -2
      libavcodec/truemotion1.c
  27. +2
    -0
      libavcodec/utils.c
  28. +0
    -2
      libavcodec/vcr1.c
  29. +0
    -1
      libavcodec/vmdav.c
  30. +0
    -2
      libavcodec/vp3.c

+ 0
- 2
libavcodec/4xm.c View File

@@ -600,8 +600,6 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame *p, temp;
int i, frame_4cc, frame_size;

*data_size = 0;

/* special case for last picture */
if (buf_size == 0) {
return 0;


+ 0
- 1
libavcodec/a52dec.c View File

@@ -160,7 +160,6 @@ static int a52_decode_frame(AVCodecContext *avctx,
2, 1, 2, 3, 3, 4, 4, 5
};

*data_size = 0;
buf_ptr = buf;
while (buf_size > 0) {
len = s->inbuf_ptr - s->inbuf;


+ 0
- 1
libavcodec/ac3dec.c View File

@@ -92,7 +92,6 @@ static int ac3_decode_frame(AVCodecContext *avctx,
2, 1, 2, 3, 3, 4, 4, 5
};

*data_size = 0;
buf_ptr = buf;
while (buf_size > 0) {
len = s->inbuf_ptr - s->inbuf;


+ 0
- 2
libavcodec/adpcm.c View File

@@ -568,7 +568,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
if(st) { /* handle stereo interlacing */
c->channel = (channel + 1) % 2; /* we get one packet for left, then one for right data */
if(channel == 1) { /* wait for the other packet before outputing anything */
*data_size = 0;
return src - buf;
}
}
@@ -842,7 +841,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
break;
default:
*data_size = 0;
return -1;
}
*data_size = (uint8_t *)samples - (uint8_t *)data;


+ 0
- 3
libavcodec/amr.c View File

@@ -221,7 +221,6 @@ static int amr_nb_decode_frame(AVCodecContext * avctx,
Word16 serial[SERIAL_FRAMESIZE]; /* coded bits */
Word16 *synth;
UWord8 *packed_bits;
*data_size=0;

static Word16 packed_size[16] = {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0};
int i;
@@ -416,7 +415,6 @@ static int amr_nb_decode_frame(AVCodecContext * avctx,
static short block_size[16]={ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };
enum Mode dec_mode;
int packet_size;
*data_size=0;

//printf("amr_decode_frame data_size=%i buf=0x%X buf_size=%d frameCount=%d!!\n",*data_size,buf,buf_size,s->frameCount);

@@ -603,7 +601,6 @@ static int amr_wb_decode_frame(AVCodecContext * avctx,
int offset=0;
int mode;
int packet_size;
*data_size=0;

while(offset<buf_size)
{


+ 0
- 2
libavcodec/asv1.c View File

@@ -403,8 +403,6 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame * const p= (AVFrame*)&a->picture;
int mb_x, mb_y;

*data_size = 0;

/* special case for last picture */
if (buf_size == 0) {
return 0;


+ 0
- 2
libavcodec/cljr.c View File

@@ -43,8 +43,6 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame * const p= (AVFrame*)&a->picture;
int x, y;

*data_size = 0;

/* special case for last picture */
if (buf_size == 0) {
return 0;


+ 0
- 2
libavcodec/cyuv.c View File

@@ -81,8 +81,6 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
unsigned char cur_byte;
int pixel_groups;

*data_size = 0;

/* sanity check the buffer size: A buffer has 3x16-bytes tables
* followed by (height) lines each with 3 bytes to represent groups
* of 4 pixels. Thus, the total size of the buffer ought to be:


+ 0
- 1
libavcodec/dv.c View File

@@ -889,7 +889,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
{
DVVideoContext *s = avctx->priv_data;
*data_size=0;
/* special case for last picture */
if(buf_size==0)
return 0;


+ 0
- 2
libavcodec/ffv1.c View File

@@ -941,8 +941,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8

AVFrame *picture = data;

*data_size = 0;

/* no supplementary picture */
if (buf_size == 0)
return 0;


+ 0
- 2
libavcodec/flac.c View File

@@ -546,8 +546,6 @@ static int flac_decode_frame(AVCodecContext *avctx,
int tmp = 0, i, j = 0, input_buf_size;
int16_t *samples = data, *left, *right;

*data_size = 0;

s->avctx = avctx;
if(s->max_framesize == 0){


+ 0
- 2
libavcodec/h263dec.c View File

@@ -417,8 +417,6 @@ uint64_t time= rdtsc();
s->flags= avctx->flags;
s->flags2= avctx->flags2;

*data_size = 0;

/* no supplementary picture */
if (buf_size == 0) {
/* special case for last picture */


+ 0
- 2
libavcodec/h264.c View File

@@ -5713,8 +5713,6 @@ static int decode_frame(AVCodecContext *avctx,
s->flags= avctx->flags;
s->flags2= avctx->flags2;

*data_size = 0;
/* no supplementary picture */
if (buf_size == 0) {
return 0;


+ 0
- 2
libavcodec/huffyuv.c View File

@@ -684,8 +684,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8

AVFrame *picture = data;

*data_size = 0;

/* no supplementary picture */
if (buf_size == 0)
return 0;


+ 0
- 1
libavcodec/indeo3.c View File

@@ -1058,7 +1058,6 @@ static int indeo3_decode_frame(AVCodecContext *avctx,

/* no supplementary picture */
if (buf_size == 0) {
*data_size = 0;
return 0;
}



+ 0
- 1
libavcodec/mace.c View File

@@ -421,7 +421,6 @@ puts("mace_decode_frame[6]()");
*data_size = 2 * 6 * buf_size;
break;
default:
*data_size = 0;
return -1;
}
return buf_size;


+ 0
- 6
libavcodec/mjpeg.c View File

@@ -1724,8 +1724,6 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
int start_code;
AVFrame *picture = data;

*data_size = 0;

/* no supplementary picture */
if (buf_size == 0)
return 0;
@@ -1902,8 +1900,6 @@ static int mjpegb_decode_frame(AVCodecContext *avctx,
uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
uint32_t field_size;

*data_size = 0;

/* no supplementary picture */
if (buf_size == 0)
return 0;
@@ -2015,8 +2011,6 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
uint8_t *buf_ptr, *buf_end, *recoded;
int i = 0, j = 0;

*data_size = 0;

/* no supplementary picture */
if (buf_size == 0)
return 0;


+ 0
- 2
libavcodec/mpeg12.c View File

@@ -2791,8 +2791,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
MpegEncContext *s2 = &s->mpeg_enc_ctx;
dprintf("fill_buffer\n");

*data_size = 0;

/* special case for last picture */
if (buf_size == 0 && s2->low_delay==0 && s2->next_picture_ptr) {
*picture= *(AVFrame*)s2->next_picture_ptr;


+ 0
- 1
libavcodec/mpegaudiodec.c View File

@@ -2520,7 +2520,6 @@ static int decode_frame(AVCodecContext * avctx,
int len, out_size;
short *out_samples = data;

*data_size = 0;
buf_ptr = buf;
while (buf_size > 0) {
len = s->inbuf_ptr - s->inbuf;


+ 0
- 1
libavcodec/oggvorbis.c View File

@@ -264,7 +264,6 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext,
if(!buf_size){
//FIXME flush
*data_size=0;
return 0;
}


+ 0
- 1
libavcodec/raw.c View File

@@ -118,7 +118,6 @@ static int raw_decode(AVCodecContext *avctx,
if (buf_size < bytesNeeded) {
memcpy(context->p, buf, buf_size);
context->p += buf_size;
*data_size = 0;
return buf_size;
}



+ 0
- 2
libavcodec/roqvideo.c View File

@@ -450,8 +450,6 @@ static int roq_decode_frame(AVCodecContext *avctx,
{
RoqContext *s = avctx->priv_data;

*data_size = 0;

if (avctx->get_buffer(avctx, &s->current_frame)) {
av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
return -1;


+ 0
- 3
libavcodec/rv10.c View File

@@ -651,7 +651,6 @@ static int rv10_decode_frame(AVCodecContext *avctx,

/* no supplementary picture */
if (buf_size == 0) {
*data_size = 0;
return 0;
}

@@ -685,8 +684,6 @@ static int rv10_decode_frame(AVCodecContext *avctx,
}
*data_size = sizeof(AVFrame);
}else{
*data_size = 0;
}

return buf_size;


+ 0
- 4
libavcodec/svq1.c View File

@@ -600,7 +600,6 @@ static uint16_t svq1_packet_checksum (uint8_t *data, int length, int value) {
return value;
}

#if 0
static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,
int width, int height, int value) {
int x, y;
@@ -615,7 +614,6 @@ static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,

return value;
}
#endif

static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
uint8_t seed;
@@ -715,8 +713,6 @@ static int svq1_decode_frame(AVCodecContext *avctx,
int result, i, x, y, width, height;
AVFrame *pict = data;

*data_size=0;
if(buf==NULL && buf_size==0){
return 0;
}


+ 0
- 2
libavcodec/svq3.c View File

@@ -769,8 +769,6 @@ static int svq3_decode_frame (AVCodecContext *avctx,
unsigned char *extradata;
unsigned int size;

*data_size = 0;

s->flags = avctx->flags;
s->flags2 = avctx->flags2;
s->unrestricted_mv = 1;


+ 0
- 2
libavcodec/truemotion1.c View File

@@ -547,8 +547,6 @@ static int truemotion1_decode_frame(AVCodecContext *avctx,
if (buf_size == 0)
return 0;

*data_size = 0;
if (truemotion1_decode_header(s) == -1)
return -1;



+ 2
- 0
libavcodec/utils.c View File

@@ -488,6 +488,7 @@ int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
{
int ret;
*got_picture_ptr= 0;
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
buf, buf_size);

@@ -508,6 +509,7 @@ int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
{
int ret;

*frame_size_ptr= 0;
ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
buf, buf_size);
avctx->frame_number++;


+ 0
- 2
libavcodec/vcr1.c View File

@@ -45,8 +45,6 @@ static int decode_frame(AVCodecContext *avctx,
uint8_t *bytestream= buf;
int i, x, y;

*data_size = 0;

/* special case for last picture */
if (buf_size == 0) {
return 0;


+ 0
- 1
libavcodec/vmdav.c View File

@@ -522,7 +522,6 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
if (buf_size < 16)
return buf_size;

*data_size = 0;
if (buf[6] == 1) {
/* the chunk contains audio */
*data_size = vmdaudio_loadsound(s, output_samples, p, 0);


+ 0
- 2
libavcodec/vp3.c View File

@@ -2474,8 +2474,6 @@ static int vp3_decode_frame(AVCodecContext *avctx,
GetBitContext gb;
static int counter = 0;

*data_size = 0;

init_get_bits(&gb, buf, buf_size * 8);
if (s->theora && get_bits1(&gb))


Loading…
Cancel
Save