diff navigation.c @ 95:e7ebabe059b9 src

Start to get dvd mrl working in xine.
author jcdutton
date Mon, 16 Sep 2002 16:54:41 +0000
parents e29110f67f3a
children b6834e6359cf
line wrap: on
line diff
--- a/navigation.c	Mon Sep 16 16:27:18 2002 +0000
+++ b/navigation.c	Mon Sep 16 16:54:41 2002 +0000
@@ -62,18 +62,23 @@
   return S_OK;
 }
 
-/* This function should not be used. FIXME: Suggest alternative */
-dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *this, int *programs) {
+dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *this, int title, int *parts) {
   if(!this)
    return S_ERR;
 
-  if(!programs) {
+  if(!parts) {
     printerr("Passed a NULL pointer");
     return S_ERR;
   }
-
-  (*programs) = this->vm->state.pgc->nr_of_programs;
-
+  if(!this->started) {
+    printerr("Virtual DVD machine not started.");
+    return S_ERR;
+  }
+  if ((title < 1) || (title > vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts) ) {
+    printerr("Passed a title number out of range");
+    return S_ERR;
+  }
+  (*parts) = vm_get_vmgi(this->vm)->tt_srpt->title[title-1].nr_of_ptts;
   return S_OK;
 }