summaryrefslogtreecommitdiffstats
path: root/libhb/dvd.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-05-01 17:27:51 +0000
committerjstebbins <[email protected]>2009-05-01 17:27:51 +0000
commit8cab795c817920ff023b6f0b8992a588e62c08c5 (patch)
tree37d6ba0f2bd800c152f23aba35edd7f42408b0c6 /libhb/dvd.c
parent0bef438147a6807abb2b594d30451bb5d97933aa (diff)
dvdnav: improve title scanning
- looks for ptt with longest pgc sequence instead of just picking first ptt solves many 'short title' problems - constructs chapters from the pg's within the pgc's instead of using ptt's solve the problem of ptt's that point to an intro pgc instead of to the actual chapter position in the title. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2361 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r--libhb/dvd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index 8bc61944f..cf6eefe49 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -16,7 +16,7 @@ static void hb_dvdread_close( hb_dvd_t ** _d );
static char * hb_dvdread_name( char * path );
static int hb_dvdread_title_count( hb_dvd_t * d );
static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * d, int t );
-static int hb_dvdread_start( hb_dvd_t * d, int title, int chapter );
+static int hb_dvdread_start( hb_dvd_t * d, hb_title_t *title, int chapter );
static void hb_dvdread_stop( hb_dvd_t * d );
static int hb_dvdread_seek( hb_dvd_t * d, float f );
static int hb_dvdread_read( hb_dvd_t * d, hb_buffer_t * b );
@@ -651,15 +651,16 @@ cleanup:
***********************************************************************
* Title and chapter start at 1
**********************************************************************/
-static int hb_dvdread_start( hb_dvd_t * e, int title, int chapter )
+static int hb_dvdread_start( hb_dvd_t * e, hb_title_t *title, int chapter )
{
hb_dvdread_t *d = &(e->dvdread);
int pgc_id, pgn;
int i;
+ int t = title->index;
/* Open the IFO and the VOBs for this title */
- d->vts = d->vmg->tt_srpt->title[title-1].title_set_nr;
- d->ttn = d->vmg->tt_srpt->title[title-1].vts_ttn;
+ d->vts = d->vmg->tt_srpt->title[t-1].title_set_nr;
+ d->ttn = d->vmg->tt_srpt->title[t-1].vts_ttn;
if( !( d->ifo = ifoOpen( d->reader, d->vts ) ) )
{
hb_error( "dvd: ifoOpen failed for VTS %d", d->vts );
@@ -1257,7 +1258,7 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
return dvd_methods->title_scan(d, t);
}
-int hb_dvd_start( hb_dvd_t * d, int title, int chapter )
+int hb_dvd_start( hb_dvd_t * d, hb_title_t *title, int chapter )
{
return dvd_methods->start(d, title, chapter);
}