changeset 32123:a86413775fbe

Replace sizeof(BITMAPINFOHEADER)
author reimar
date Sun, 12 Sep 2010 16:08:57 +0000
parents 0f9662ec84d0
children 93c6a603f4d3
files 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
diffstat 12 files changed, 24 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/TOOLS/vivodump.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/TOOLS/vivodump.c	Sun Sep 12 16:08:57 2010 +0000
@@ -212,8 +212,8 @@
 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;
--- a/libmpcodecs/ve_libdv.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpcodecs/ve_libdv.c	Sun Sep 12 16:08:57 2010 +0000
@@ -113,8 +113,8 @@
     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');
--- a/libmpcodecs/ve_nuv.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpcodecs/ve_nuv.c	Sun Sep 12 16:08:57 2010 +0000
@@ -225,8 +225,8 @@
   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;
--- a/libmpcodecs/ve_x264.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpcodecs/ve_x264.c	Sun Sep 12 16:08:57 2010 +0000
@@ -185,9 +185,9 @@
 
         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 @@
 
     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');
--- a/libmpcodecs/ve_xvid4.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpcodecs/ve_xvid4.c	Sun Sep 12 16:08:57 2010 +0000
@@ -605,7 +605,7 @@
 	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 @@
 		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;
--- a/libmpdemux/demux_gif.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpdemux/demux_gif.c	Sun Sep 12 16:08:57 2010 +0000
@@ -280,7 +280,7 @@
   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;
--- a/libmpdemux/demux_lmlm4.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpdemux/demux_lmlm4.c	Sun Sep 12 16:08:57 2010 +0000
@@ -310,7 +310,7 @@
     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;
--- a/libmpdemux/demux_mng.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpdemux/demux_mng.c	Sun Sep 12 16:08:57 2010 +0000
@@ -444,7 +444,7 @@
     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;
--- a/libmpdemux/demux_nemesi.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpdemux/demux_nemesi.c	Sun Sep 12 16:08:57 2010 +0000
@@ -269,12 +269,12 @@
                                             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);
--- a/libmpdemux/demux_nut.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpdemux/demux_nut.c	Sun Sep 12 16:08:57 2010 +0000
@@ -147,7 +147,7 @@
 		}
 		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 @@
 				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;
--- a/libmpdemux/demux_ogg.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpdemux/demux_ogg.c	Sun Sep 12 16:08:57 2010 +0000
@@ -906,8 +906,8 @@
             } 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;
--- a/libmpdemux/demux_rawdv.c	Sun Sep 12 16:03:46 2010 +0000
+++ b/libmpdemux/demux_rawdv.c	Sun Sep 12 16:08:57 2010 +0000
@@ -190,7 +190,7 @@
    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;