diff options
author | John Stebbins <[email protected]> | 2016-05-17 11:51:25 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-05-17 11:51:25 -0600 |
commit | de858d1600ac61258dc895b2fc8756b7c5d1d3a8 (patch) | |
tree | cdbd82e3d9ee83cfb9a31ebbb034852aa36fb2cb /libhb/dvd.c | |
parent | 9dcce9df07f4db1fa61f25ffeb106aa00bd64190 (diff) |
libhb: send initial chapter through pipeline
Eliminate the need for everyone to assume that the first chapter starts
at the first frame.
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r-- | libhb/dvd.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c index 7255aec74..ab06efd3a 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -1056,11 +1056,7 @@ static hb_buffer_t * hb_dvdread_read( hb_dvd_t * e ) d->cur_vob_id = dsi_pack.dsi_gi.vobu_vob_idn; d->cur_cell_id = dsi_pack.dsi_gi.vobu_c_idn; - if( d->cell_overlap ) - { - b->s.new_chap = hb_dvdread_is_break( d ); - d->cell_overlap = 0; - } + d->cell_overlap = 0; } } @@ -1095,6 +1091,10 @@ static hb_buffer_t * hb_dvdread_read( hb_dvd_t * e ) } d->pack_len--; } + if (b != NULL) + { + b->s.new_chap = hb_dvdread_is_break( d ); + } d->block++; @@ -1149,9 +1149,7 @@ static int hb_dvdread_is_break( hb_dvdread_t * d ) pgc_t * pgc; int cell; - for( i = nr_of_ptts - 1; - i > 0; - i-- ) + for (i = nr_of_ptts - 1; i >= 0; i--) { /* Get pgc for chapter (i+1) */ pgc_id = d->ifo->vts_ptt_srpt->title[d->ttn-1].ptt[i].pgcn; @@ -1159,11 +1157,11 @@ static int hb_dvdread_is_break( hb_dvdread_t * d ) pgc = d->ifo->vts_pgcit->pgci_srp[pgc_id-1].pgc; cell = pgc->program_map[pgn-1] - 1; - if( cell <= d->cell_start ) + if( cell < d->cell_start ) break; // This must not match against the start cell. - if( pgc->cell_playback[cell].first_sector == d->block && cell != d->cell_start ) + if (pgc->cell_playback[cell].first_sector == d->block) { return i + 1; } |