gst-plugins-ugly: dvdreadsrc: fix off by one in cell calculation for the last chapter

Vincent Penquerc'h vincent at kemper.freedesktop.org
Fri Jan 13 07:04:20 PST 2012


Module: gst-plugins-ugly
Branch: master
Commit: 683f5eeae7b830e4e4b790f3817ff6b8ce517b1c
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=683f5eeae7b830e4e4b790f3817ff6b8ce517b1c

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Fri Jan 13 15:03:50 2012 +0000

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

---

 ext/dvdread/dvdreadsrc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c
index 1ed59e5..9877f07 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



More information about the gstreamer-commits mailing list