diff options
author | Rodeo <[email protected]> | 2012-05-03 16:04:28 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-05-03 16:04:28 +0000 |
commit | 4aeadc9bc63d200d6c0b709eba7e25c4f3afe24c (patch) | |
tree | 4d73da1a557826fd4b553172180f6cd455b5ecbb /libhb/dvdnav.c | |
parent | 9b3507211cff2ddf6bec9072d7767e461bdc0fa7 (diff) |
libhb: if no source chapter name information is available, set default chapters names explicitly (rather than leaving it to the interfaces).
Standardize calculation of chapter->hours, chapter->minutes and chapter->seconds across all sources.
Get rid of an unused variable in libhb/dvd.c
Ignore chapter names set by MakeMKV. "Chapter 1" is just as good as, if not better than "Chapter 01" or even "Chapter 00".
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4636 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvdnav.c')
-rw-r--r-- | libhb/dvdnav.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c index 8b356e188..e40a02f05 100644 --- a/libhb/dvdnav.c +++ b/libhb/dvdnav.c @@ -721,9 +721,11 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura { chapter = calloc( sizeof( hb_chapter_t ), 1 ); - chapter->index = c + 1; chapter->pgcn = pgcn; chapter->pgn = i; + chapter->index = c + 1; + sprintf( chapter->title, "Chapter %d", chapter->index ); + hb_list_add( title->list_chapter, chapter ); c++; } @@ -780,13 +782,13 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura duration_correction = (float) title->duration / (float) duration; for( i = 0; i < hb_list_count( title->list_chapter ); i++ ) { - int seconds; - chapter = hb_list_item( title->list_chapter, i ); - chapter->duration = duration_correction * chapter->duration; - seconds = ( chapter->duration + 45000 ) / 90000; - chapter->hours = seconds / 3600; - chapter->minutes = ( seconds % 3600 ) / 60; - chapter->seconds = seconds % 60; + chapter = hb_list_item( title->list_chapter, i ); + chapter->duration = duration_correction * chapter->duration; + + int seconds = ( chapter->duration + 45000 ) / 90000; + chapter->hours = ( seconds / 3600 ); + chapter->minutes = ( seconds % 3600 ) / 60; + chapter->seconds = ( seconds % 60 ); hb_log( "scan: chap %d c=%d->%d, b=%"PRIu64"->%"PRIu64" (%"PRIu64"), %"PRId64" ms", chapter->index, chapter->cell_start, chapter->cell_end, |