ext/dvdread/dvdreadsrc.c: Error out properly if this is an interactive DVD (fixes...
authorTim-Philipp Müller <tim@centricular.net>
Mon, 7 Aug 2006 16:25:45 +0000 (16:25 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Mon, 7 Aug 2006 16:25:45 +0000 (16:25 +0000)
Original commit message from CVS:
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_goto_title):
Error out properly if this is an interactive DVD (fixes #345694).

ChangeLog
ext/dvdread/dvdreadsrc.c

index a50d59e..a7a149e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-07  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_goto_title):
+         Error out properly if this is an interactive DVD (fixes #345694).
+
 2006-08-07  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * ext/a52dec/gsta52dec.c: (gst_a52dec_chain):
index bc7a38b..cbcbfa6 100644 (file)
@@ -464,6 +464,12 @@ gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle)
   src->ttn = src->tt_srpt->title[title].vts_ttn;
   src->vts_ptt_srpt = src->vts_file->vts_ptt_srpt;
 
+  /* interactive title? */
+  if (src->num_chapters > 0 &&
+      src->vts_ptt_srpt->title[src->ttn - 1].ptt[0].pgn == 0) {
+    goto commands_only_pgc;
+  }
+
   /* we've got enough info, time to open the title set data */
   src->dvd_title = DVDOpenFile (src->dvd, title_set_nr, DVD_READ_TITLE_VOBS);
   if (src->dvd_title == NULL)
@@ -579,6 +585,14 @@ title_open_failed:
         ("Can't open title VOBS (VTS_%02d_1.VOB)", title_set_nr));
     return FALSE;
   }
+commands_only_pgc:
+  {
+    GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
+        (_("Could not open DVD title %d. Interactive titles are not supported "
+                "by this element"), title_set_nr),
+        ("Commands-only PGC, not supported, use dvdnavsrc"));
+    return FALSE;
+  }
 }
 
 /* FIXME: double-check this function, compare against original */