From 692f6b5d9529672cbc7d293cd310b8eaca835111 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 21 Dec 2011 13:56:35 +0100 Subject: [PATCH] dvdreadsrc: minor safety tweak to sector seeking --- ext/dvdread/dvdreadsrc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index f1dbfbce5d..7675dc74d9 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -1585,7 +1585,8 @@ gst_dvd_read_src_goto_sector (GstDvdReadSrc * src, int angle) gint first = src->cur_pgc->cell_playback[cur].first_sector; gint last = src->cur_pgc->cell_playback[cur].last_sector; GST_DEBUG_OBJECT (src, "Cell %d sector bounds: %d %d", cur, first, last); - if (seek_to >= first && seek_to <= last) { + /* seeking to 0 should end up at first chapter in any case */ + if ((seek_to >= first && seek_to <= last) || (seek_to == 0 && i == 0)) { GST_DEBUG_OBJECT (src, "Seek target found in chapter %d", i); chapter = i; goto done;