[Mplayer-cvslog] CVS: main dec_video.c,1.110,1.111

Nick Kurshev nick at mplayer.dev.hu
Wed Feb 27 12:16:55 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv4337/main

Modified Files:
	dec_video.c 
Log Message:
We should know size of out buffer

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- dec_video.c	24 Feb 2002 17:10:06 -0000	1.110
+++ dec_video.c	27 Feb 2002 11:16:52 -0000	1.111
@@ -455,6 +455,7 @@
 pitches[0] = pitches[1] =pitches[2] = 0; /* fake unknown */
 
 sh_video->our_out_buffer=NULL;
+sh_video->our_out_buffer_size=0U;
 
 sh_video->image=new_mp_image(sh_video->disp_w,sh_video->disp_h);
 mp_image_setfmt(sh_video->image,out_fmt);
@@ -464,8 +465,8 @@
 #ifdef USE_MP_IMAGE
    sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
-   sh_video->our_out_buffer = 
-     (char*)memalign(64, sh_video->disp_w * sh_video->disp_h * 1.5);
+   sh_video->our_out_buffer_size = sh_video->disp_w * sh_video->disp_h * 1.5;
+   sh_video->our_out_buffer = (char*)memalign(64, sh_video->our_out_buffer_size);
 #endif
    sh_video->context = roq_decode_video_init();
    break;
@@ -474,8 +475,8 @@
    sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
    int bpp=((out_fmt&255)+7)/8;
-   sh_video->our_out_buffer = 
-     (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*bpp);
+   sh_video->our_out_buffer_size = sh_video->disp_w*sh_video->disp_h*bpp;
+   sh_video->our_out_buffer = (char*)memalign(64, sh_video->our_out_buffer_size);
 #endif
    sh_video->context = decode_cinepak_init();
    break;
@@ -548,8 +549,8 @@
      bpp=((out_fmt&255)+7)&(~7);
      DS_VideoDecoder_SetDestFmt(ds_vdec,out_fmt&255,0);           // RGB/BGR
    }
-
-   sh_video->our_out_buffer = (char*)memalign(64,sh_video->disp_w*sh_video->disp_h*bpp/8); // FIXME!!!
+   sh_video->our_out_buffer_size = sh_video->disp_w*sh_video->disp_h*bpp/8; // FIXME!!!
+   sh_video->our_out_buffer = (char*)memalign(64,sh_video->our_out_buffer_size); 
 #endif
    /* Warning: these pitches tested only with YUY2 fourcc */
    pitches[0] = 16; pitches[1] = pitches[2] = 8;
@@ -625,7 +626,8 @@
 #ifdef USE_MP_IMAGE
 	sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
-	sh_video->our_out_buffer = (char*)memalign(64,((bits*dec_param.x_dim+7)/8)*dec_param.y_dim);
+	sh_video->our_out_buffer_size = ((bits*dec_param.x_dim+7)/8)*dec_param.y_dim;
+	sh_video->our_out_buffer = (char*)memalign(64,sh_video->our_out_buffer_size);
 //	sh_video->our_out_buffer = shmem_alloc(dec_param.x_dim*dec_param.y_dim*5);
 #endif
    }
@@ -699,7 +701,8 @@
 #ifdef USE_MP_IMAGE
     sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
-    sh_video->our_out_buffer = (char*)memalign(64,sh_video->disp_w*sh_video->disp_h*bpp); // FIXME!!!
+    sh_video->our_out_buffer_size = sh_video->disp_w*sh_video->disp_h*bpp; // FIXME!!!
+    sh_video->our_out_buffer = (char*)memalign(64,sh_video->our_out_buffer_size); 
 #endif
    if(bpp==2){  // 15 or 16 bpp ==> palette conversion!
      unsigned int* pal=(unsigned int*)(((char*)sh_video->bih)+40);
@@ -734,8 +737,8 @@
     sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
    int bpp=((out_fmt&255)+7)/8; // RGB only
-   sh_video->our_out_buffer = 
-     (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*bpp); // FIXME!!!
+   sh_video->our_out_buffer_size =  sh_video->disp_w*sh_video->disp_h*bpp; // FIXME!!!
+   sh_video->our_out_buffer = (char*)memalign(64,sh_video->our_out_buffer_size); 
 #endif
 if ((sh_video->codec->driver == VFM_QTRLE) && (sh_video->bih->biBitCount != 24))
   printf (
@@ -754,8 +757,8 @@
     sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
    int bpp=((out_fmt&255)+7)/8; // RGB only
-   sh_video->our_out_buffer = 
-     (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*bpp); // FIXME!!!
+   sh_video->our_out_buffer_size = sh_video->disp_w*sh_video->disp_h*bpp; // FIXME!!!
+   sh_video->our_out_buffer = (char*)memalign(64, sh_video->our_out_buffer_size); 
 #endif
    break;
    }
@@ -763,7 +766,8 @@
 #ifdef USE_MP_IMAGE
     sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
-    sh_video->our_out_buffer = (char *)memalign(64, sh_video->disp_w*sh_video->disp_h*3/2);
+    sh_video->our_out_buffer_size =  sh_video->disp_w*sh_video->disp_h*3/2;
+    sh_video->our_out_buffer = (char *)memalign(64,sh_video->our_out_buffer_size);
 #endif
    break;
  case VFM_CYUV: {
@@ -771,8 +775,8 @@
 #ifdef USE_MP_IMAGE
     sh_video->image->type=MP_IMGTYPE_STATIC;
 #else
-   sh_video->our_out_buffer =
-     (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*3);
+   sh_video->our_out_buffer_size = sh_video->disp_w*sh_video->disp_h*3;
+   sh_video->our_out_buffer = (char*)memalign(64, sh_video->our_out_buffer_size);
 #endif
    break;
    }




More information about the MPlayer-cvslog mailing list