changeset 2028:141a9539e270 libavcodec

data_size = 0 cleanup
author michael
date Fri, 21 May 2004 14:37:16 +0000
parents 3a78447c3b53
children 934117474c3b
files 4xm.c a52dec.c ac3dec.c adpcm.c amr.c asv1.c cljr.c cyuv.c dv.c ffv1.c flac.c h263dec.c h264.c huffyuv.c indeo3.c mace.c mjpeg.c mpeg12.c mpegaudiodec.c oggvorbis.c raw.c roqvideo.c rv10.c svq1.c svq3.c truemotion1.c utils.c vcr1.c vmdav.c vp3.c
diffstat 30 files changed, 2 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/4xm.c	Fri May 21 14:29:25 2004 +0000
+++ b/4xm.c	Fri May 21 14:37:16 2004 +0000
@@ -600,8 +600,6 @@
     AVFrame *p, temp;
     int i, frame_4cc, frame_size;
 
-    *data_size = 0;
-
     /* special case for last picture */
     if (buf_size == 0) {
         return 0;
--- a/a52dec.c	Fri May 21 14:29:25 2004 +0000
+++ b/a52dec.c	Fri May 21 14:37:16 2004 +0000
@@ -160,7 +160,6 @@
 	2, 1, 2, 3, 3, 4, 4, 5
     };
 
-    *data_size = 0;
     buf_ptr = buf;
     while (buf_size > 0) {
         len = s->inbuf_ptr - s->inbuf;
--- a/ac3dec.c	Fri May 21 14:29:25 2004 +0000
+++ b/ac3dec.c	Fri May 21 14:37:16 2004 +0000
@@ -92,7 +92,6 @@
 	2, 1, 2, 3, 3, 4, 4, 5
     };
 
-    *data_size = 0;
     buf_ptr = buf;
     while (buf_size > 0) {
         len = s->inbuf_ptr - s->inbuf;
--- a/adpcm.c	Fri May 21 14:29:25 2004 +0000
+++ b/adpcm.c	Fri May 21 14:37:16 2004 +0000
@@ -568,7 +568,6 @@
         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 @@
         }
         break;
     default:
-        *data_size = 0;
         return -1;
     }
     *data_size = (uint8_t *)samples - (uint8_t *)data;
--- a/amr.c	Fri May 21 14:29:25 2004 +0000
+++ b/amr.c	Fri May 21 14:37:16 2004 +0000
@@ -221,7 +221,6 @@
     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 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 @@
     int offset=0;
     int mode;
     int packet_size;
-    *data_size=0;
 
     while(offset<buf_size)
     {
--- a/asv1.c	Fri May 21 14:29:25 2004 +0000
+++ b/asv1.c	Fri May 21 14:37:16 2004 +0000
@@ -403,8 +403,6 @@
     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;
--- a/cljr.c	Fri May 21 14:29:25 2004 +0000
+++ b/cljr.c	Fri May 21 14:37:16 2004 +0000
@@ -43,8 +43,6 @@
     AVFrame * const p= (AVFrame*)&a->picture;
     int x, y;
 
-    *data_size = 0;
-
     /* special case for last picture */
     if (buf_size == 0) {
         return 0;
--- a/cyuv.c	Fri May 21 14:29:25 2004 +0000
+++ b/cyuv.c	Fri May 21 14:37:16 2004 +0000
@@ -81,8 +81,6 @@
     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:
--- a/dv.c	Fri May 21 14:29:25 2004 +0000
+++ b/dv.c	Fri May 21 14:37:16 2004 +0000
@@ -889,7 +889,6 @@
 {
     DVVideoContext *s = avctx->priv_data;
   
-    *data_size=0;
     /* special case for last picture */
     if(buf_size==0)
         return 0;
--- a/ffv1.c	Fri May 21 14:29:25 2004 +0000
+++ b/ffv1.c	Fri May 21 14:37:16 2004 +0000
@@ -941,8 +941,6 @@
 
     AVFrame *picture = data;
 
-    *data_size = 0;
-
     /* no supplementary picture */
     if (buf_size == 0)
         return 0;
--- a/flac.c	Fri May 21 14:29:25 2004 +0000
+++ b/flac.c	Fri May 21 14:37:16 2004 +0000
@@ -546,8 +546,6 @@
     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){
--- a/h263dec.c	Fri May 21 14:29:25 2004 +0000
+++ b/h263dec.c	Fri May 21 14:37:16 2004 +0000
@@ -417,8 +417,6 @@
     s->flags= avctx->flags;
     s->flags2= avctx->flags2;
 
-    *data_size = 0;
-
     /* no supplementary picture */
     if (buf_size == 0) {
         /* special case for last picture */
--- a/h264.c	Fri May 21 14:29:25 2004 +0000
+++ b/h264.c	Fri May 21 14:37:16 2004 +0000
@@ -5713,8 +5713,6 @@
     s->flags= avctx->flags;
     s->flags2= avctx->flags2;
 
-    *data_size = 0;
-   
    /* no supplementary picture */
     if (buf_size == 0) {
         return 0;
--- a/huffyuv.c	Fri May 21 14:29:25 2004 +0000
+++ b/huffyuv.c	Fri May 21 14:37:16 2004 +0000
@@ -684,8 +684,6 @@
 
     AVFrame *picture = data;
 
-    *data_size = 0;
-
     /* no supplementary picture */
     if (buf_size == 0)
         return 0;
--- a/indeo3.c	Fri May 21 14:29:25 2004 +0000
+++ b/indeo3.c	Fri May 21 14:37:16 2004 +0000
@@ -1058,7 +1058,6 @@
 
     /* no supplementary picture */
     if (buf_size == 0) {
-        *data_size = 0;
         return 0;
     }
 
--- a/mace.c	Fri May 21 14:29:25 2004 +0000
+++ b/mace.c	Fri May 21 14:37:16 2004 +0000
@@ -421,7 +421,6 @@
         *data_size = 2 * 6 * buf_size;
         break;
     default:
-        *data_size = 0;
         return -1;
     }
     return buf_size;
--- a/mjpeg.c	Fri May 21 14:29:25 2004 +0000
+++ b/mjpeg.c	Fri May 21 14:37:16 2004 +0000
@@ -1724,8 +1724,6 @@
     int start_code;
     AVFrame *picture = data;
 
-    *data_size = 0;
-
     /* no supplementary picture */
     if (buf_size == 0)
         return 0;
@@ -1902,8 +1900,6 @@
     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 @@
     uint8_t *buf_ptr, *buf_end, *recoded;
     int i = 0, j = 0;
 
-    *data_size = 0;
-
     /* no supplementary picture */
     if (buf_size == 0)
         return 0;
--- a/mpeg12.c	Fri May 21 14:29:25 2004 +0000
+++ b/mpeg12.c	Fri May 21 14:37:16 2004 +0000
@@ -2791,8 +2791,6 @@
     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;
--- a/mpegaudiodec.c	Fri May 21 14:29:25 2004 +0000
+++ b/mpegaudiodec.c	Fri May 21 14:37:16 2004 +0000
@@ -2520,7 +2520,6 @@
     int len, out_size;
     short *out_samples = data;
 
-    *data_size = 0;
     buf_ptr = buf;
     while (buf_size > 0) {
 	len = s->inbuf_ptr - s->inbuf;
--- a/oggvorbis.c	Fri May 21 14:29:25 2004 +0000
+++ b/oggvorbis.c	Fri May 21 14:37:16 2004 +0000
@@ -264,7 +264,6 @@
  
     if(!buf_size){
     //FIXME flush
-        *data_size=0;
         return 0;
     }
     
--- a/raw.c	Fri May 21 14:29:25 2004 +0000
+++ b/raw.c	Fri May 21 14:37:16 2004 +0000
@@ -118,7 +118,6 @@
     if (buf_size < bytesNeeded) {
         memcpy(context->p, buf, buf_size);
         context->p += buf_size;
-        *data_size = 0;
         return buf_size;
     }
 
--- a/roqvideo.c	Fri May 21 14:29:25 2004 +0000
+++ b/roqvideo.c	Fri May 21 14:37:16 2004 +0000
@@ -450,8 +450,6 @@
 {
     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;
--- a/rv10.c	Fri May 21 14:29:25 2004 +0000
+++ b/rv10.c	Fri May 21 14:37:16 2004 +0000
@@ -651,7 +651,6 @@
 
     /* no supplementary picture */
     if (buf_size == 0) {
-        *data_size = 0;
         return 0;
     }
 
@@ -685,8 +684,6 @@
         }
         
         *data_size = sizeof(AVFrame);
-    }else{
-        *data_size = 0;
     }
 
     return buf_size;
--- a/svq1.c	Fri May 21 14:29:25 2004 +0000
+++ b/svq1.c	Fri May 21 14:37:16 2004 +0000
@@ -600,7 +600,6 @@
   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 @@
 
   return value;
 }
-#endif
 
 static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
   uint8_t seed;
@@ -715,8 +713,6 @@
   int		result, i, x, y, width, height;
   AVFrame *pict = data; 
 
-  *data_size=0;
-  
   if(buf==NULL && buf_size==0){
       return 0;
   }
--- a/svq3.c	Fri May 21 14:29:25 2004 +0000
+++ b/svq3.c	Fri May 21 14:37:16 2004 +0000
@@ -769,8 +769,6 @@
   unsigned char *extradata;
   unsigned int size;
 
-  *data_size = 0;
-
   s->flags = avctx->flags;
   s->flags2 = avctx->flags2;
   s->unrestricted_mv = 1;
--- a/truemotion1.c	Fri May 21 14:29:25 2004 +0000
+++ b/truemotion1.c	Fri May 21 14:37:16 2004 +0000
@@ -547,8 +547,6 @@
     if (buf_size == 0)
         return 0;
 
-    *data_size = 0;
-    
     if (truemotion1_decode_header(s) == -1)
         return -1;
 
--- a/utils.c	Fri May 21 14:29:25 2004 +0000
+++ b/utils.c	Fri May 21 14:37:16 2004 +0000
@@ -488,6 +488,7 @@
 {
     int ret;
     
+    *got_picture_ptr= 0;
     ret = avctx->codec->decode(avctx, picture, got_picture_ptr, 
                                buf, buf_size);
 
@@ -508,6 +509,7 @@
 {
     int ret;
 
+    *frame_size_ptr= 0;
     ret = avctx->codec->decode(avctx, samples, frame_size_ptr, 
                                buf, buf_size);
     avctx->frame_number++;
--- a/vcr1.c	Fri May 21 14:29:25 2004 +0000
+++ b/vcr1.c	Fri May 21 14:37:16 2004 +0000
@@ -45,8 +45,6 @@
     uint8_t *bytestream= buf;
     int i, x, y;
 
-    *data_size = 0;
-
     /* special case for last picture */
     if (buf_size == 0) {
         return 0;
--- a/vmdav.c	Fri May 21 14:29:25 2004 +0000
+++ b/vmdav.c	Fri May 21 14:37:16 2004 +0000
@@ -522,7 +522,6 @@
     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);
--- a/vp3.c	Fri May 21 14:29:25 2004 +0000
+++ b/vp3.c	Fri May 21 14:37:16 2004 +0000
@@ -2474,8 +2474,6 @@
     GetBitContext gb;
     static int counter = 0;
 
-    *data_size = 0;
-
     init_get_bits(&gb, buf, buf_size * 8);
     
     if (s->theora && get_bits1(&gb))