[Mplayer-cvslog] CVS: main dec_video.c,1.100,1.101 cinepak.c,1.3,1.4

Mike Melanson melanson at mplayer.dev.hu
Sun Feb 10 02:23:39 CET 2002


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

Modified Files:
	dec_video.c cinepak.c 
Log Message:
Fixed FILM demuxer so that it now plays (my) FILM files
correctly; modified Cinepak decoder in order to deal with the deviant CVID
data from FILM files


Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- dec_video.c	9 Feb 2002 20:05:49 -0000	1.100
+++ dec_video.c	10 Feb 2002 01:23:36 -0000	1.101
@@ -824,9 +824,14 @@
   //--------------------  Decode a frame: -----------------------
 switch(sh_video->codec->driver){
  case VFM_CINEPAK:
-   decode_cinepak(sh_video->context, start, in_size, sh_video->our_out_buffer,
-      sh_video->disp_w, sh_video->disp_h, (out_fmt==IMGFMT_YUY2)?16:(out_fmt&255));
-   blit_frame = 3;
+   if (in_size == 0)
+     blit_frame = 0;
+   else
+   {
+     decode_cinepak(sh_video->context, start, in_size, sh_video->our_out_buffer,
+       sh_video->disp_w, sh_video->disp_h, (out_fmt==IMGFMT_YUY2)?16:(out_fmt&255));
+     blit_frame = 3;
+   }
    break;
 #ifdef USE_XANIM
   case VFM_XANIM: {

Index: cinepak.c
===================================================================
RCS file: /cvsroot/mplayer/main/cinepak.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cinepak.c	10 Jan 2002 05:58:49 -0000	1.3
+++ cinepak.c	10 Feb 2002 01:23:36 -0000	1.4
@@ -36,7 +36,7 @@
 typedef struct {
 	cvid_codebook *v4_codebook[MAX_STRIPS];
 	cvid_codebook *v1_codebook[MAX_STRIPS];
-	int strip_num;
+	unsigned long strip_num;
 } cinepak_info;
 
 
@@ -392,6 +392,7 @@
 long len, top_size, chunk_size;
 unsigned char *frm_ptr, *frm_end;
 int i, cur_strip, d0, d1, d2, d3, frm_stride, bpp = 3;
+int modulo;
 void (*read_codebook)(cvid_codebook *c, int mode) = read_codebook_24;
 void (*cvid_v1)(unsigned char *frm, unsigned char *end, int stride, cvid_codebook *cb) = cvid_v1_24;
 void (*cvid_v4)(unsigned char *frm, unsigned char *end, int stride, cvid_codebook *cb0,
@@ -498,7 +499,7 @@
 		x = 0;
 		if(x1 != width) 
 			printf("CVID: Warning x1 (%ld) != width (%d)\n", x1, width);
-
+x1 = width;
 #if DBUG
 	printf("   %d) %04lx %04ld <%ld,%ld> <%ld,%ld> yt %ld  %d\n",
 		cur_strip, strip_id, top_size, x0, y0, x1, y1, y_bottom);
@@ -520,9 +521,12 @@
 					/* -------------------- Codebook Entries -------------------- */
 				case 0x2000:
 				case 0x2200:
+					modulo = chunk_size % 6;
 					codebook = (chunk_id == 0x2200 ? v1_codebook : v4_codebook);
-					cnum = chunk_size/6;
+					cnum = (chunk_size - modulo) / 6;
 					for(i = 0; i < cnum; i++) read_codebook(codebook+i, 0);
+					while (modulo--)
+						get_byte();
 					break;
 
 				case 0x2400:
@@ -537,7 +541,7 @@
 					codebook = (chunk_id == 0x2300 ? v1_codebook : v4_codebook);
 
 					ci = 0;
-					while(chunk_size > 0)
+					while(chunk_size > 3)
 						{
 						flag = get_long();
 						chunk_size -= 4;




More information about the MPlayer-cvslog mailing list