comparison vm.c @ 109:f41eae322bd1 src

warning: ugly fix ahead! (see comment in the code for details) But I hate it when DVDs do not work with libdvdnav and after checking a bunch of other DVDs it seems that this fix is unlikely to break anything else, so I decided to commit it. "Back to the Future" menus are working fine now.
author mroi
date Fri, 22 Nov 2002 17:14:26 +0000
parents e984044bbe7b
children ac50954e1345
comparison
equal deleted inserted replaced
108:293bb1798e86 109:f41eae322bd1
356 position->cell = (vm->state).cellN; 356 position->cell = (vm->state).cellN;
357 position->cell_restart = (vm->state).cell_restart; 357 position->cell_restart = (vm->state).cell_restart;
358 position->still = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].still_time; 358 position->still = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].still_time;
359 position->vobu_start = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector; 359 position->vobu_start = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector;
360 position->vobu_next = (vm->state).blockN; 360 position->vobu_next = (vm->state).blockN;
361 /* position->vobu_next = 0; Just for now */ 361
362 /* still already detrmined or not at PGC end */
363 if (position->still || (vm->state).cellN < (vm->state).pgc->nr_of_cells)
364 return 1;
365 /* handle PGC stills */
366 if ((vm->state).pgc->still_time) {
367 position->still = (vm->state).pgc->still_time;
368 return 1;
369 }
370 /* This is a rough fix for some strange still situations on some strange DVDs.
371 * There are discs (like the German "Back to the Future" RC2) where the only
372 * indication of a still is a cell playback time higher than the time the frames
373 * in this cell actually take to play (like 1 frame with 1 minute playback time).
374 * On the said BTTF disc, for these cells last_sector and last_vobu_start_sector
375 * are equal and the cells are very short, so we abuse these conditions to
376 * detect such discs. I consider these discs broken, so the fix is somewhat
377 * broken, too. */
378 if (((vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_sector ==
379 (vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_vobu_start_sector) &&
380 ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_sector -
381 (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector < 200)) {
382 int time;
383 time = ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.hour & 0xf0) * 36000;
384 time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.hour & 0x0f) * 3600;
385 time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.minute & 0xf0) * 600;
386 time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.minute & 0x0f) * 60;
387 time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.second & 0xf0) * 10;
388 time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.second & 0x0f) * 1;
389 if (time > 0xff) time = 0xff;
390 position->still = time;
391 }
392
362 return 1; 393 return 1;
363 } 394 }
364 395
365 int vm_position_print(vm_t *vm, vm_position_t *position) { 396 int vm_position_print(vm_t *vm, vm_position_t *position) {
366 fprintf(MSG_OUT, "libdvdnav: But=%x Spu=%x Aud=%x Ang=%x Hop=%x vts=%x dom=%x cell=%x cell_restart=%x still=%x start=%x next=%x\n", 397 fprintf(MSG_OUT, "libdvdnav: But=%x Spu=%x Aud=%x Ang=%x Hop=%x vts=%x dom=%x cell=%x cell_restart=%x still=%x start=%x next=%x\n",
1986 return pgcit; 2017 return pgcit;
1987 } 2018 }
1988 2019
1989 /* 2020 /*
1990 * $Log$ 2021 * $Log$
2022 * Revision 1.38 2002/11/22 17:14:26 mroi
2023 * warning: ugly fix ahead! (see comment in the code for details)
2024 * But I hate it when DVDs do not work with libdvdnav and after checking a bunch of
2025 * other DVDs it seems that this fix is unlikely to break anything else, so I
2026 * decided to commit it. "Back to the Future" menus are working fine now.
2027 *
1991 * Revision 1.37 2002/10/23 11:38:09 mroi 2028 * Revision 1.37 2002/10/23 11:38:09 mroi
1992 * port Stephen's comment fixing to avoid problems when syncing xine-lib's copy of 2029 * port Stephen's comment fixing to avoid problems when syncing xine-lib's copy of
1993 * libdvdnav 2030 * libdvdnav
1994 * 2031 *
1995 * Revision 1.36 2002/09/22 11:53:32 mroi 2032 * Revision 1.36 2002/09/22 11:53:32 mroi