]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
data_size = 0 cleanup
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 21 May 2004 14:37:16 +0000 (14:37 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 21 May 2004 14:37:16 +0000 (14:37 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3146 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

30 files changed:
libavcodec/4xm.c
libavcodec/a52dec.c
libavcodec/ac3dec.c
libavcodec/adpcm.c
libavcodec/amr.c
libavcodec/asv1.c
libavcodec/cljr.c
libavcodec/cyuv.c
libavcodec/dv.c
libavcodec/ffv1.c
libavcodec/flac.c
libavcodec/h263dec.c
libavcodec/h264.c
libavcodec/huffyuv.c
libavcodec/indeo3.c
libavcodec/mace.c
libavcodec/mjpeg.c
libavcodec/mpeg12.c
libavcodec/mpegaudiodec.c
libavcodec/oggvorbis.c
libavcodec/raw.c
libavcodec/roqvideo.c
libavcodec/rv10.c
libavcodec/svq1.c
libavcodec/svq3.c
libavcodec/truemotion1.c
libavcodec/utils.c
libavcodec/vcr1.c
libavcodec/vmdav.c
libavcodec/vp3.c

index 50dc4a55bd6b3ea32126d4cd2838cb1443e0bbf3..fd84f896842b247c2171a4159a26a9ea59fffc3d 100644 (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;
index a22391f7ffd22695fbae9ba86e4778784f3ebbac..76c63b79052000d3fac6b0b222916e217985f3e2 100644 (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;
index 53bfa56a854e9f065ad4ab5870d710909fba567f..fcfb3147a11233263ebdf14656487ffb92853a08 100644 (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;
index 2ce7dc87f54fe6d8e7dda9b604f8b200a0374abe..0755e24fefaf2148ead8df173fb38b6a7ad94f53 100644 (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;
index 93f775b6f607ae421204b2f81d403c3d7f2bb46c..7b097a26ea2e6dc37479f7a3350cf9a8302c3989 100644 (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)
     {
index 24916590f8e518597c91f501400a00b77a3cfac5..2ab729c1764a04e5f2fe36df59de5d7473f2fc43 100644 (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;
index 912a050fbd27d5c5e60a127b181c18e6756ca6fd..df1f798514ce8574d9f343dcde38e5e57a97592b 100644 (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;
index aee2bc5ecce3bba5e72340fd2ee2215128dd0df8..82bc21005ca845c474c7b32909cc9001b7b56329 100644 (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:
index 8addf8536746ebbf03ff02e06fd2ab527f15d364..8e359e361b756b8c1c4ff05a4f4852c597607993 100644 (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;
index 01ab08a741dc0aebf00b264c6b84adee49367167..a85baea4b6ff86232d8eb8db984b3595b9d99637 100644 (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;
index 38e09363ab1c096e2eddde70cf29614431b42cec..7e92fa59ec1923ee0849432ae72515ddd3ed43ba 100644 (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){
index ea8badb9dc63ef330e602d1a480c38314ebad029..1ffefa1b20ff76e8a0b0cbcd7876801cbdd6504f 100644 (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 */
index 77c3393efc3ed54af25a142584f82f8deb182452..594a4b2642b08b2e7599434ca05f82ed320ec523 100644 (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;
index 210d454190ab29d263df724889ab0272cef8bb1d..ecc6a5fa2130d015215953394bbf72b6066bed02 100644 (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;
index 12f4ced6d2585fc6a9b7f25585c2c7736df2a3e0..14ff02858da294d89365836658620363bf244e16 100644 (file)
@@ -1058,7 +1058,6 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
 
     /* no supplementary picture */
     if (buf_size == 0) {
-        *data_size = 0;
         return 0;
     }
 
index 1beac6c40ddc2c58a0bb2645b72862ba614b8231..8a4a20568ce0e79db285aa2d4d6d23b0ec063724 100644 (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;
index 78a620fd3c2f6709af1fe810e1754df5f4b167c8..4e2305aef6c45782edb8570b8d5b83430422e138 100644 (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;
index 93e21af1009daf970c2fba98958f3b806f9c23c2..c967908d60e8b8998235abb822de60567163edb1 100644 (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;
index a9eed4e36a383b303869c99225121fd1339d115e..f9cb389aa268b06690967bfdb897575a74da1b77 100644 (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;
index 1ae3b624c6b95b0d826a67f89c22cd825054aa7b..f24f4fae72268c90d8aece1bca98bfb580094945 100644 (file)
@@ -264,7 +264,6 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext,
  
     if(!buf_size){
     //FIXME flush
-        *data_size=0;
         return 0;
     }
     
index ee4b6fdc66d47a33ba60c7f1a6e095491efb614f..8c554c41c57029be14b0db9004ee49d38302949c 100644 (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;
     }
 
index bd26961dc19be3361f211e81bc6f3800de0d6313..7d6b518ee4b29078d746355d5535a1eab0443394 100644 (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;
index b67ec3974c2f33cab262ff8ae1d31dbd56e0dc3f..ade21db55e84eb10f3be25cb3d91b430e6b028e8 100644 (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;
index b4f8e03b0b2e06f0a9a38ea69ca17886f78c6854..a841816af2f4023c55f9e23054607874c100bae1 100644 (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;
   }
index 413cc8963730f577f756fd68af6d5fee63e621d3..e064626fc1f442f5379a45423b62d4d6c0e381d3 100644 (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;
index 2f6310192553f8c30b07bd2690ed071e77eeb9cf..b742d80be49c53c35174a40c42f89ec38fc36d51 100644 (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;
 
index df2a1e135979fa32c6856ecc026a0d82e4e41e0b..df5aebb9ce9e0cb34a82974ae4a07127a9ff4101 100644 (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++;
index 05539452a46ff099dc4fadf0da35eba2c8cf1f62..9a706af31513cb24c18c9fae613bd42f51b199e5 100644 (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;
index c09af13697e7cac628036d20b1160bdd61be56f4..c11f80af6ad2f1313f2b64536af70bee14a75907 100644 (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);
index 59d183505ec8ee59abd1657190a6ecf2a7e11794..e140ae3fdb9e0b79849aa7a424db7946ff2b47c9 100644 (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))