]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/commitdiff
dvdreadsrc: fix off by one in cell calculation for the last chapter
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 13 Jan 2012 15:03:50 +0000 (15:03 +0000)
committerNikhil Devshatwar <a0132237@ti.com>
Fri, 17 May 2013 09:40:54 +0000 (15:10 +0530)
ext/dvdread/dvdreadsrc.c

index 1ed59e54f8a007b58469659ec5bbf79345f8a8d5..9877f072478a54ebfc40cbc443d3e767ce40411a 100644 (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