changeset 135:5204d4e4cd3b src

I should get a brain and learn how to handle BCD... also fixing a possible mis-jump with angled cells
author mroi
date Wed, 26 Mar 2003 14:37:23 +0000
parents d9d75a22a061
children 5897ff629f7c
files dvdnav.c vm.c
diffstat 2 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/dvdnav.c	Tue Mar 25 12:46:29 2003 +0000
+++ b/dvdnav.c	Wed Mar 26 14:37:23 2003 +0000
@@ -210,14 +210,16 @@
   int64_t result;
   int frames;
   
-  result  = (time->hour    & 0xf0) * 10 * 60 * 60 * 90000;
+  result  = (time->hour    >> 4  ) * 10 * 60 * 60 * 90000;
   result += (time->hour    & 0x0f)      * 60 * 60 * 90000;
-  result += (time->minute  & 0xf0)      * 10 * 60 * 90000;
+  result += (time->minute  >> 4  )      * 10 * 60 * 90000;
   result += (time->minute  & 0x0f)           * 60 * 90000;
-  result += (time->second  & 0xf0)           * 10 * 90000;
+  result += (time->second  >> 4  )           * 10 * 90000;
   result += (time->second  & 0x0f)                * 90000;
-  frames  = (time->frame_u & 0x30)                * 10   ;
-  frames += (time->frame_u & 0x0f)                       ;
+  
+  frames  = ((time->frame_u & 0x30) >> 4) * 10;
+  frames += ((time->frame_u & 0x0f)     )     ;
+  
   if (time->frame_u & 0x80)
     result += frames * 3000;
   else
@@ -1016,6 +1018,10 @@
 
 /*
  * $Log$
+ * Revision 1.47  2003/03/26 14:37:22  mroi
+ * I should get a brain and learn how to handle BCD...
+ * also fixing a possible mis-jump with angled cells
+ *
  * Revision 1.46  2003/03/25 12:46:26  mroi
  * - new event on cell changes to report program and cell number and some time info
  * - get rid of memcopies in event handling
--- a/vm.c	Tue Mar 25 12:46:29 2003 +0000
+++ b/vm.c	Wed Mar 26 14:37:23 2003 +0000
@@ -444,11 +444,11 @@
     int time;
     int size = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_sector -
 	       (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector;
-    time  = ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.hour   & 0xf0) * 36000;
+    time  = ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.hour   >> 4  ) * 36000;
     time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.hour   & 0x0f) * 3600;
-    time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.minute & 0xf0) * 600;
+    time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.minute >> 4  ) * 600;
     time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.minute & 0x0f) * 60;
-    time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.second & 0xf0) * 10;
+    time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.second >> 4  ) * 10;
     time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.second & 0x0f) * 1;
     if (size / time > 30)
       /* datarate is too high, it might be a very short, but regular cell */
@@ -474,7 +474,9 @@
 int vm_jump_cell_block(vm_t *vm, int cell, int block) {
   (vm->state).cellN = cell;
   process_command(vm, play_Cell(vm));
-  (vm->state).blockN = block;
+  /* play_Cell can jump to a different cell in case of angles */
+  if ((vm->state).cellN == cell)
+    (vm->state).blockN = block;
   return 1;
 }
 
@@ -1805,6 +1807,10 @@
 
 /*
  * $Log$
+ * Revision 1.48  2003/03/26 14:37:23  mroi
+ * I should get a brain and learn how to handle BCD...
+ * also fixing a possible mis-jump with angled cells
+ *
  * Revision 1.47  2003/03/24 16:42:59  mroi
  * determine correct PG and PTT numbers when seeking across PG boundaries
  *