* hb_dvdnav_start *********************************************************************** * Title and chapter start at 1 **********************************************************************/
| 1456 | * Title and chapter start at 1 |
| 1457 | **********************************************************************/ |
| 1458 | static int hb_dvdnav_start( hb_dvd_t * e, hb_title_t *title, int c ) |
| 1459 | { |
| 1460 | hb_dvdnav_t * d = &(e->dvdnav); |
| 1461 | int t = title->index; |
| 1462 | hb_dvd_chapter_t *chapter; |
| 1463 | dvdnav_status_t result; |
| 1464 | |
| 1465 | if ( d->stopped && !hb_dvdnav_reset(d) ) |
| 1466 | { |
| 1467 | return 0; |
| 1468 | } |
| 1469 | if (!TitleOpenIfo(d, t)) |
| 1470 | { |
| 1471 | return 0; |
| 1472 | } |
| 1473 | dvdnav_reset( d->dvdnav ); |
| 1474 | chapter = hb_list_item( d->list_dvd_chapter, c - 1); |
| 1475 | if (chapter != NULL) |
| 1476 | result = dvdnav_program_play(d->dvdnav, t, chapter->pgcn, chapter->pgn); |
| 1477 | else |
| 1478 | result = dvdnav_part_play(d->dvdnav, t, 1); |
| 1479 | if (result != DVDNAV_STATUS_OK) |
| 1480 | { |
| 1481 | hb_error( "dvd: dvdnav_*_play failed - %s", |
| 1482 | dvdnav_err_to_string(d->dvdnav) ); |
| 1483 | return 0; |
| 1484 | } |
| 1485 | d->stopped = 0; |
| 1486 | d->chapter = 0; |
| 1487 | d->cell = 0; |
| 1488 | return 1; |
| 1489 | } |
| 1490 | |
| 1491 | /*********************************************************************** |
| 1492 | * hb_dvdnav_stop |
nothing calls this directly
no test coverage detected