diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 50dc4a55bd6b3ea32126d4cd2838cb1443e0bbf3..fd84f896842b247c2171a4159a26a9ea59fffc3d 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 a22391f7ffd22695fbae9ba86e4778784f3ebbac..76c63b79052000d3fac6b0b222916e217985f3e2 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 53bfa56a854e9f065ad4ab5870d710909fba567f..fcfb3147a11233263ebdf14656487ffb92853a08 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 2ce7dc87f54fe6d8e7dda9b604f8b200a0374abe..0755e24fefaf2148ead8df173fb38b6a7ad94f53 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 93f775b6f607ae421204b2f81d403c3d7f2bb46c..7b097a26ea2e6dc37479f7a3350cf9a8302c3989 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(offset<buf_size) { diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 24916590f8e518597c91f501400a00b77a3cfac5..2ab729c1764a04e5f2fe36df59de5d7473f2fc43 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -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; diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 912a050fbd27d5c5e60a127b181c18e6756ca6fd..df1f798514ce8574d9f343dcde38e5e57a97592b 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 aee2bc5ecce3bba5e72340fd2ee2215128dd0df8..82bc21005ca845c474c7b32909cc9001b7b56329 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 8addf8536746ebbf03ff02e06fd2ab527f15d364..8e359e361b756b8c1c4ff05a4f4852c597607993 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 01ab08a741dc0aebf00b264c6b84adee49367167..a85baea4b6ff86232d8eb8db984b3595b9d99637 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 38e09363ab1c096e2eddde70cf29614431b42cec..7e92fa59ec1923ee0849432ae72515ddd3ed43ba 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 ea8badb9dc63ef330e602d1a480c38314ebad029..1ffefa1b20ff76e8a0b0cbcd7876801cbdd6504f 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 77c3393efc3ed54af25a142584f82f8deb182452..594a4b2642b08b2e7599434ca05f82ed320ec523 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 210d454190ab29d263df724889ab0272cef8bb1d..ecc6a5fa2130d015215953394bbf72b6066bed02 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 12f4ced6d2585fc6a9b7f25585c2c7736df2a3e0..14ff02858da294d89365836658620363bf244e16 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 1beac6c40ddc2c58a0bb2645b72862ba614b8231..8a4a20568ce0e79db285aa2d4d6d23b0ec063724 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 78a620fd3c2f6709af1fe810e1754df5f4b167c8..4e2305aef6c45782edb8570b8d5b83430422e138 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 93e21af1009daf970c2fba98958f3b806f9c23c2..c967908d60e8b8998235abb822de60567163edb1 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 a9eed4e36a383b303869c99225121fd1339d115e..f9cb389aa268b06690967bfdb897575a74da1b77 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 1ae3b624c6b95b0d826a67f89c22cd825054aa7b..f24f4fae72268c90d8aece1bca98bfb580094945 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 ee4b6fdc66d47a33ba60c7f1a6e095491efb614f..8c554c41c57029be14b0db9004ee49d38302949c 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 bd26961dc19be3361f211e81bc6f3800de0d6313..7d6b518ee4b29078d746355d5535a1eab0443394 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 b67ec3974c2f33cab262ff8ae1d31dbd56e0dc3f..ade21db55e84eb10f3be25cb3d91b430e6b028e8 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 b4f8e03b0b2e06f0a9a38ea69ca17886f78c6854..a841816af2f4023c55f9e23054607874c100bae1 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 413cc8963730f577f756fd68af6d5fee63e621d3..e064626fc1f442f5379a45423b62d4d6c0e381d3 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 2f6310192553f8c30b07bd2690ed071e77eeb9cf..b742d80be49c53c35174a40c42f89ec38fc36d51 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 df2a1e135979fa32c6856ecc026a0d82e4e41e0b..df5aebb9ce9e0cb34a82974ae4a07127a9ff4101 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 05539452a46ff099dc4fadf0da35eba2c8cf1f62..9a706af31513cb24c18c9fae613bd42f51b199e5 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 c09af13697e7cac628036d20b1160bdd61be56f4..c11f80af6ad2f1313f2b64536af70bee14a75907 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 59d183505ec8ee59abd1657190a6ecf2a7e11794..e140ae3fdb9e0b79849aa7a424db7946ff2b47c9 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))