From 53db1cae1c2d555d207563e0197809faf23b3dcc Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 21 May 2004 14:37:16 +0000 Subject: data_size = 0 cleanup Originally committed as revision 3146 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/4xm.c | 2 -- libavcodec/a52dec.c | 1 - libavcodec/ac3dec.c | 1 - libavcodec/adpcm.c | 2 -- libavcodec/amr.c | 3 --- libavcodec/asv1.c | 2 -- libavcodec/cljr.c | 2 -- libavcodec/cyuv.c | 2 -- libavcodec/dv.c | 1 - libavcodec/ffv1.c | 2 -- libavcodec/flac.c | 2 -- libavcodec/h263dec.c | 2 -- libavcodec/h264.c | 2 -- libavcodec/huffyuv.c | 2 -- libavcodec/indeo3.c | 1 - libavcodec/mace.c | 1 - libavcodec/mjpeg.c | 6 ------ libavcodec/mpeg12.c | 2 -- libavcodec/mpegaudiodec.c | 1 - libavcodec/oggvorbis.c | 1 - libavcodec/raw.c | 1 - libavcodec/roqvideo.c | 2 -- libavcodec/rv10.c | 3 --- libavcodec/svq1.c | 4 ---- libavcodec/svq3.c | 2 -- libavcodec/truemotion1.c | 2 -- libavcodec/utils.c | 2 ++ libavcodec/vcr1.c | 2 -- libavcodec/vmdav.c | 1 - libavcodec/vp3.c | 2 -- 30 files changed, 2 insertions(+), 57 deletions(-) diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 50dc4a55bd..fd84f89684 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -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; diff --git a/libavcodec/a52dec.c b/libavcodec/a52dec.c index a22391f7ff..76c63b7905 100644 --- a/libavcodec/a52dec.c +++ b/libavcodec/a52dec.c @@ -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; diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 53bfa56a85..fcfb3147a1 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -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; diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 2ce7dc87f5..0755e24fef 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -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; diff --git a/libavcodec/amr.c b/libavcodec/amr.c index 93f775b6f6..7b097a26ea 100644 --- a/libavcodec/amr.c +++ b/libavcodec/amr.c @@ -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(offsetpicture; int mb_x, mb_y; - *data_size = 0; - /* special case for last picture */ if (buf_size == 0) { return 0; diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 912a050fbd..df1f798514 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -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; diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index aee2bc5ecc..82bc21005c 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -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: diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 8addf85367..8e359e361b 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -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; diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 01ab08a741..a85baea4b6 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -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; diff --git a/libavcodec/flac.c b/libavcodec/flac.c index 38e09363ab..7e92fa59ec 100644 --- a/libavcodec/flac.c +++ b/libavcodec/flac.c @@ -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){ diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index ea8badb9dc..1ffefa1b20 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -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 */ diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 77c3393efc..594a4b2642 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -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; diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 210d454190..ecc6a5fa21 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -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; diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 12f4ced6d2..14ff02858d 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1058,7 +1058,6 @@ static int indeo3_decode_frame(AVCodecContext *avctx, /* no supplementary picture */ if (buf_size == 0) { - *data_size = 0; return 0; } diff --git a/libavcodec/mace.c b/libavcodec/mace.c index 1beac6c40d..8a4a20568c 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -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; diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 78a620fd3c..4e2305aef6 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -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; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 93e21af100..c967908d60 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -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; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index a9eed4e36a..f9cb389aa2 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -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; diff --git a/libavcodec/oggvorbis.c b/libavcodec/oggvorbis.c index 1ae3b624c6..f24f4fae72 100644 --- a/libavcodec/oggvorbis.c +++ b/libavcodec/oggvorbis.c @@ -264,7 +264,6 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, if(!buf_size){ //FIXME flush - *data_size=0; return 0; } diff --git a/libavcodec/raw.c b/libavcodec/raw.c index ee4b6fdc66..8c554c41c5 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -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; } diff --git a/libavcodec/roqvideo.c b/libavcodec/roqvideo.c index bd26961dc1..7d6b518ee4 100644 --- a/libavcodec/roqvideo.c +++ b/libavcodec/roqvideo.c @@ -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; diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index b67ec3974c..ade21db55e 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -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; diff --git a/libavcodec/svq1.c b/libavcodec/svq1.c index b4f8e03b0b..a841816af2 100644 --- a/libavcodec/svq1.c +++ b/libavcodec/svq1.c @@ -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; } diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 413cc89637..e064626fc1 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -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; diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index 2f63101925..b742d80be4 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -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; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index df2a1e1359..df5aebb9ce 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -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++; diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index 05539452a4..9a706af315 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -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; diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index c09af13697..c11f80af6a 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -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); diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 59d183505e..e140ae3fdb 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -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)) -- cgit v1.2.3