[Mplayer-cvslog] CVS: main msvidc.c,1.4,1.5

Mike Melanson melanson at mplayer.dev.hu
Wed Dec 5 05:17:27 CET 2001


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

Modified Files:
	msvidc.c 
Log Message:
fixed Video 1 bug which cut off decoding too soon, resulting in torn
frames


Index: msvidc.c
===================================================================
RCS file: /cvsroot/mplayer/main/msvidc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- msvidc.c	28 Nov 2001 15:19:14 -0000	1.4
+++ msvidc.c	5 Dec 2001 04:17:24 -0000	1.5
@@ -43,6 +43,7 @@
   int bytes_per_pixel)
 {
   int block_ptr, pixel_ptr;
+  int total_blocks;
   int pixel_x, pixel_y;  // pixel width and height iterators
   int block_x, block_y;  // block width and height iterators
   int blocks_wide, blocks_high;  // width and height in 4x4 blocks
@@ -59,6 +60,7 @@
   skip_blocks = 0;
   blocks_wide = width / 4;
   blocks_high = height / 4;
+  total_blocks = blocks_wide * blocks_high;
   block_inc = 4 * bytes_per_pixel;
   row_dec = (width + 4) * bytes_per_pixel;
 
@@ -72,6 +74,7 @@
       {
         block_ptr += block_inc;
         skip_blocks--;
+        total_blocks--;
         continue;
       }
 
@@ -82,7 +85,7 @@
       byte_b = encoded[stream_ptr++];
 
       // check if the decode is finished
-      if ((byte_a == 0) && (byte_b == 0))
+      if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0))
         return;
 
       // check if this is a skip code
@@ -204,6 +207,7 @@
       }
 
       block_ptr += block_inc;
+      total_blocks--;
     }
   }
 }
@@ -218,6 +222,7 @@
   int bytes_per_pixel)
 {
   int block_ptr, pixel_ptr;
+  int total_blocks;
   int pixel_x, pixel_y;  // pixel width and height iterators
   int block_x, block_y;  // block width and height iterators
   int blocks_wide, blocks_high;  // width and height in 4x4 blocks
@@ -234,6 +239,7 @@
   skip_blocks = 0;
   blocks_wide = width / 4;
   blocks_high = height / 4;
+  total_blocks = blocks_wide * blocks_high;
   block_inc = 4 * bytes_per_pixel;
   row_dec = (width + 4) * bytes_per_pixel;
 
@@ -247,6 +253,7 @@
       {
         block_ptr += block_inc;
         skip_blocks--;
+        total_blocks--;
         continue;
       }
 
@@ -257,7 +264,7 @@
       byte_b = encoded[stream_ptr++];
 
       // check if the decode is finished
-      if ((byte_a == 0) && (byte_b == 0))
+      if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0))
         return;
 
       // check if this is a skip code
@@ -376,6 +383,7 @@
       }
 
       block_ptr += block_inc;
+      total_blocks--;
     }
   }
 }




More information about the MPlayer-cvslog mailing list