# HG changeset patch # User mroi # Date 1048689443 0 # Node ID 5204d4e4cd3b97dc628752dde2859f4c4eae9cac # Parent d9d75a22a0610a6ae324ba2c523678d3e52855f3 I should get a brain and learn how to handle BCD... also fixing a possible mis-jump with angled cells diff -r d9d75a22a061 -r 5204d4e4cd3b dvdnav.c --- 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 diff -r d9d75a22a061 -r 5204d4e4cd3b vm.c --- 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 *