summaryrefslogtreecommitdiffstats
path: root/libhb/dvd.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2007-10-09 02:23:44 +0000
committereddyg <[email protected]>2007-10-09 02:23:44 +0000
commit1e3bd57546c713d238cad5b9d16faf61f50652e8 (patch)
tree0f24359c9301f661bbfc98dd045d52d2b2c7c1c6 /libhb/dvd.c
parentb3178968037a18c721a66e2669ae6f040a12196a (diff)
Fix to the chapter merging to ensure that when reading from the media we take into account chapters that we have merged. This prevents premature exiting from encoding.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1012 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r--libhb/dvd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index 234e55bd2..6ecaab9e9 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -386,7 +386,8 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
pgc_t * pgc_next;
chapter = calloc( sizeof( hb_chapter_t ), 1 );
- chapter->index = c;
+ /* remember the on-disc chapter number */
+ chapter->index = i + 1;
pgc_id = vts->vts_ptt_srpt->title[title->ttn-1].ptt[i].pgcn;
pgn = vts->vts_ptt_srpt->title[title->ttn-1].ptt[i].pgn;
@@ -439,14 +440,13 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
d->cell_cur = d->cell_next;
}
- if( chapter->block_count < 2048 && chapter->index > 1 )
+ if( chapter->block_count < 2048 && c > 1 )
{
- hb_log( "scan: chapter %d too short (%d blocks, "
- "cells=%d->%d), merging", chapter->index,
+ hb_log( "scan: chapter %d(%d) too short (%d blocks, "
+ "cells=%d->%d), merging", c, chapter->index,
chapter->block_count, chapter->cell_start,
chapter->cell_end );
- chapter_old = hb_list_item( title->list_chapter,
- chapter->index - 2 );
+ chapter_old = hb_list_item( title->list_chapter, c - 2 );
chapter_old->cell_end = chapter->cell_end;
chapter_old->block_end = chapter->block_end;
chapter_old->block_count += chapter->block_count;