Replace sizeof(BITMAPINFOHEADER)
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 12 Sep 2010 16:08:57 +0000 (16:08 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 12 Sep 2010 16:08:57 +0000 (16:08 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@32207 b3059339-0415-0410-9bf9-f77b7e298cf2

12 files changed:
TOOLS/vivodump.c
libmpcodecs/ve_libdv.c
libmpcodecs/ve_nuv.c
libmpcodecs/ve_x264.c
libmpcodecs/ve_xvid4.c
libmpdemux/demux_gif.c
libmpdemux/demux_lmlm4.c
libmpdemux/demux_mng.c
libmpdemux/demux_nemesi.c
libmpdemux/demux_nut.c
libmpdemux/demux_ogg.c
libmpdemux/demux_rawdv.c

index 2893fa2..5c2e81c 100644 (file)
@@ -212,8 +212,8 @@ mux->buffer=malloc(mux->buffer_size);
 mux->h.dwScale=1;
 mux->h.dwRate=10;
 
-mux->bih=malloc(sizeof(BITMAPINFOHEADER));
-mux->bih->biSize=sizeof(BITMAPINFOHEADER);
+mux->bih=malloc(sizeof(*mux->bih));
+mux->bih->biSize=sizeof(*mux->bih);
 mux->bih->biPlanes=1;
 mux->bih->biBitCount=24;
 mux->bih->biCompression=0x6f766976;//      7669766f;
index 37497cf..36751c8 100644 (file)
@@ -113,8 +113,8 @@ static int vf_open(vf_instance_t *vf, char* args){
     vf->priv->enc=dv_encoder_new(0,1,1); // FIXME, parse some options!
     if(!vf->priv->enc) return 0;
 
-    mux_v->bih=calloc(1, sizeof(BITMAPINFOHEADER));
-    mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
+    mux_v->bih=calloc(1, sizeof(*mux_v->bih));
+    mux_v->bih->biSize=sizeof(*mux_v->bih);
     mux_v->bih->biWidth=0;
     mux_v->bih->biHeight=0;
     mux_v->bih->biCompression=mmioFOURCC('d','v','s','d');
index eb144f9..bf9e694 100644 (file)
@@ -225,8 +225,8 @@ static int vf_open(vf_instance_t *vf, char* args){
   memcpy(vf->priv, &nuv_priv_dflt,sizeof(struct vf_priv_s));
   vf->priv->mux=(muxer_stream_t*)args;
 
-  mux_v->bih=calloc(1, sizeof(BITMAPINFOHEADER));
-  mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
+  mux_v->bih=calloc(1, sizeof(*mux_v->bih));
+  mux_v->bih->biSize=sizeof(*mux_v->bih);
   mux_v->bih->biWidth=0;
   mux_v->bih->biHeight=0;
   mux_v->bih->biPlanes=1;
index eb49cf9..3dd2789 100644 (file)
@@ -185,9 +185,9 @@ static int config(struct vf_instance *vf, int width, int height, int d_width, in
 
         extradata_size = x264_encoder_headers(mod->x264, &nal, &nnal);
 
-        mod->mux->bih= realloc(mod->mux->bih, sizeof(BITMAPINFOHEADER) + extradata_size);
+        mod->mux->bih= realloc(mod->mux->bih, sizeof(*mod->mux->bih) + extradata_size);
         memcpy(mod->mux->bih + 1, nal->p_payload, extradata_size);
-        mod->mux->bih->biSize= sizeof(BITMAPINFOHEADER) + extradata_size;
+        mod->mux->bih->biSize= sizeof(*mod->mux->bih) + extradata_size;
     }
 
     if (param.i_bframe > 1 && param.i_bframe_pyramid)
@@ -293,8 +293,8 @@ static int vf_open(vf_instance_t *vf, char *args) {
 
     mod=(h264_module_t*)vf->priv;
     mod->mux = (muxer_stream_t*)args;
-    mod->mux->bih = calloc(1, sizeof(BITMAPINFOHEADER));
-    mod->mux->bih->biSize = sizeof(BITMAPINFOHEADER);
+    mod->mux->bih = calloc(1, sizeof(*mod->mux->bih));
+    mod->mux->bih->biSize = sizeof(*mod->mux->bih);
     mod->mux->bih->biPlanes = 1;
     mod->mux->bih->biBitCount = 24;
     mod->mux->bih->biCompression = mmioFOURCC('h', '2', '6', '4');
index e68707b..1decf3c 100644 (file)
@@ -605,7 +605,7 @@ vf_open(vf_instance_t *vf, char* args)
        mod->mux = (muxer_stream_t*)args;
 
        /* Initialize muxer BITMAP header */
-       mod->mux->bih = calloc(1, sizeof(BITMAPINFOHEADER));
+       mod->mux->bih = calloc(1, sizeof(*mod->mux->bih));
 
        if(mod->mux->bih  == NULL) {
                mp_msg(MSGT_MENCODER,MSGL_ERR,
@@ -613,7 +613,7 @@ vf_open(vf_instance_t *vf, char* args)
                return BAD;
        }
 
-       mod->mux->bih->biSize = sizeof(BITMAPINFOHEADER);
+       mod->mux->bih->biSize = sizeof(*mod->mux->bih);
        mod->mux->bih->biWidth = 0;
        mod->mux->bih->biHeight = 0;
        mod->mux->bih->biPlanes = 1;
index f18c807..516522f 100644 (file)
@@ -280,7 +280,7 @@ static demuxer_t* demux_open_gif(demuxer_t* demuxer)
   sh_video->fps = 5.0f;
   sh_video->frametime = 1.0f / sh_video->fps;
 
-  sh_video->bih = malloc(sizeof(BITMAPINFOHEADER) + (256 * 4));
+  sh_video->bih = malloc(sizeof(*sh_video->bih) + (256 * 4));
   sh_video->bih->biCompression = sh_video->format;
   sh_video->bih->biWidth = priv->w = (uint16_t)gif->SWidth;
   sh_video->bih->biHeight = priv->h = (uint16_t)gif->SHeight;
index 0952f14..1772418 100644 (file)
@@ -310,7 +310,7 @@ static demuxer_t* demux_open_lmlm4(demuxer_t* demuxer){
     sh_video->disp_h = 480;
     sh_video->format = mmioFOURCC('D','I','V','X');
 
-    sh_video->bih = calloc(1, sizeof(BITMAPINFOHEADER));
+    sh_video->bih = calloc(1, sizeof(*sh_video->bih));
 
     /* these are false values */
     sh_video->bih->biSize = 40;
index bab7430..0eb9944 100644 (file)
@@ -444,7 +444,7 @@ static demuxer_t * demux_mng_open(demuxer_t * demuxer)
     sh_video->frametime = 1.0f / sh_video->fps;
 
     // set video frame parameters
-    sh_video->bih                = malloc(sizeof(BITMAPINFOHEADER));
+    sh_video->bih                = malloc(sizeof(*sh_video->bih));
     sh_video->bih->biCompression = sh_video->format;
     sh_video->bih->biWidth       = mng_priv->width;
     sh_video->bih->biHeight      = mng_priv->height;
index b6978c0..17e6886 100644 (file)
@@ -269,12 +269,12 @@ static demuxer_t* demux_open_rtp(demuxer_t* demuxer)
                                             sess, &buff, &fps);
 
                 if (buff.len) {
-                    bih = calloc(1,sizeof(BITMAPINFOHEADER)+buff.len);
-                    bih->biSize = sizeof(BITMAPINFOHEADER)+buff.len;
+                    bih = calloc(1,sizeof(*bih)+buff.len);
+                    bih->biSize = sizeof(*bih)+buff.len;
                     memcpy(bih+1, buff.data, buff.len);
                 } else {
-                    bih = calloc(1,sizeof(BITMAPINFOHEADER));
-                    bih->biSize = sizeof(BITMAPINFOHEADER);
+                    bih = calloc(1,sizeof(*bih));
+                    bih->biSize = sizeof(*bih);
                 }
 
                 sh_video = new_sh_video(demuxer,0);
index 169337e..e70ba81 100644 (file)
@@ -147,7 +147,7 @@ static demuxer_t * demux_open_nut(demuxer_t * demuxer) {
                }
                case NUT_VIDEO_CLASS: {
                        BITMAPINFOHEADER * bih =
-                               calloc(sizeof(BITMAPINFOHEADER) +
+                               calloc(sizeof(*bih) +
                                              s[i].codec_specific_len, 1);
                        sh_video_t * sh_video = new_sh_video(demuxer, i);
                        int j;
@@ -171,7 +171,7 @@ static demuxer_t * demux_open_nut(demuxer_t * demuxer) {
                                s[i].sample_width / (float)s[i].sample_height;
                        sh_video->i_bps = 0; // FIXME
 
-                       bih->biSize = sizeof(BITMAPINFOHEADER) +
+                       bih->biSize = sizeof(*bih) +
                                             s[i].codec_specific_len;
                        bih->biWidth = s[i].width;
                        bih->biHeight = s[i].height;
index ca4308b..6a4b530 100644 (file)
@@ -906,8 +906,8 @@ int demux_ogg_open(demuxer_t *demuxer)
             } else {
                 sh_v = new_sh_video_vid(demuxer, ogg_d->num_sub, n_video);
 
-                sh_v->bih = calloc(1, sizeof(BITMAPINFOHEADER));
-                sh_v->bih->biSize        = sizeof(BITMAPINFOHEADER);
+                sh_v->bih = calloc(1, sizeof(*sh_v->bih));
+                sh_v->bih->biSize        = sizeof(*sh_v->bih);
                 sh_v->bih->biCompression = sh_v->format = FOURCC_THEORA;
                 sh_v->fps = ((double)inf.fps_numerator) / (double)inf.fps_denominator;
                 sh_v->frametime = ((double)inf.fps_denominator) / (double)inf.fps_numerator;
index 6a41920..d3e1b51 100644 (file)
@@ -190,7 +190,7 @@ static demuxer_t* demux_open_rawdv(demuxer_t* demuxer)
    sh_video->frametime = 1.0/sh_video->fps;
 
   // emulate BITMAPINFOHEADER for win32 decoders:
-  sh_video->bih=calloc(1, sizeof(BITMAPINFOHEADER));
+  sh_video->bih=calloc(1, sizeof(*sh_video->bih));
   sh_video->bih->biSize=40;
   sh_video->bih->biWidth = dv_decoder->width;
   sh_video->bih->biHeight = dv_decoder->height;