From 683f5eeae7b830e4e4b790f3817ff6b8ce517b1c Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Fri, 13 Jan 2012 15:03:50 +0000 Subject: [PATCH] dvdreadsrc: fix off by one in cell calculation for the last chapter --- ext/dvdread/dvdreadsrc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index 1ed59e54f8..9877f07247 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -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