dvdreadsrc: fix off by one in cell calculation for the last chapter

This commit is contained in:
Vincent Penquerc'h 2012-01-13 15:03:50 +00:00
parent 69541031da
commit 683f5eeae7

View file

@ -325,11 +325,14 @@ cur_title_get_chapter_bounds (GstDvdReadSrc * src, gint chapter,
*p_first_cell = pgc->program_map[pgn - 1] - 1;
if (chapter == (src->num_chapters - 1)) {
*p_last_cell = pgc->nr_of_cells;
*p_last_cell = pgc->nr_of_cells - 1;
} else {
pgn_next_ch = src->vts_ptt_srpt->title[src->ttn - 1].ptt[chapter + 1].pgn;
*p_last_cell = pgc->program_map[pgn_next_ch - 1] - 1;
}
GST_DEBUG_OBJECT (src, "Chapter %d bounds: %d %d (within %d cells)",
chapter, *p_first_cell, *p_last_cell, pgc->nr_of_cells);
}
static gboolean