MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_dvdnav_start

Function hb_dvdnav_start

libhb/dvdnav.c:1458–1489  ·  view source on GitHub ↗

* hb_dvdnav_start *********************************************************************** * Title and chapter start at 1 **********************************************************************/

Source from the content-addressed store, hash-verified

1456 * Title and chapter start at 1
1457 **********************************************************************/
1458static 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

Callers

nothing calls this directly

Calls 4

hb_dvdnav_resetFunction · 0.85
TitleOpenIfoFunction · 0.85
hb_list_itemFunction · 0.85
hb_errorFunction · 0.85

Tested by

no test coverage detected