diff options
author | Jan Schmidt <jan@centricular.com> | 2015-05-12 21:52:24 +1000 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2015-05-12 21:52:24 +1000 |
commit | bc7e8282d3734949f4696bd846bd092a7c37feb6 (patch) | |
tree | 5fc17d8dbfdee9c794f2c8676d843e2bcb2ef756 /ext | |
parent | f034f77b73d59754de5b3822e6075c14ae9338ee (diff) |
dvdread: Work around basesrc initial seek
Ignore the initial seek basesrc sends, as it
breaks starting from another chapter by
immediately seeking back to the start of the title
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dvdread/dvdreadsrc.c | 8 | ||||
-rw-r--r-- | ext/dvdread/dvdreadsrc.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index e0584ef9..52c0d22b 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -115,6 +115,7 @@ gst_dvd_read_src_init (GstDvdReadSrc * src) src->dvd_title = NULL; src->location = g_strdup ("/dev/dvd"); + src->first_seek = TRUE; src->new_seek = TRUE; src->new_cell = TRUE; src->change_cell = FALSE; @@ -1239,6 +1240,13 @@ gst_dvd_read_src_do_seek (GstBaseSrc * basesrc, GstSegment * s) GST_DEBUG_OBJECT (src, "Seeking to %s: %12" G_GINT64_FORMAT, gst_format_get_name (s->format), s->position); + /* Ignore the first seek to 0, as it breaks starting playback + * from another chapter by seeking back to sector 0 */ + if (src->first_seek && s->format == GST_FORMAT_BYTES && s->start == 0) { + src->first_seek = FALSE; + return TRUE; + } + if (s->format == sector_format || s->format == GST_FORMAT_BYTES || s->format == GST_FORMAT_TIME) { guint old; diff --git a/ext/dvdread/dvdreadsrc.h b/ext/dvdread/dvdreadsrc.h index 4fa63724..fbca0ee0 100644 --- a/ext/dvdread/dvdreadsrc.h +++ b/ext/dvdread/dvdreadsrc.h @@ -48,6 +48,7 @@ struct _GstDvdReadSrc { /* location */ gchar *location; + gboolean first_seek; gboolean new_seek; gboolean change_cell; |