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
This commit is contained in:
Jan Schmidt 2015-05-12 21:52:24 +10:00
parent f034f77b73
commit bc7e8282d3
2 changed files with 9 additions and 0 deletions

View file

@ -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;

View file

@ -48,6 +48,7 @@ struct _GstDvdReadSrc {
/* location */
gchar *location;
gboolean first_seek;
gboolean new_seek;
gboolean change_cell;