changeset 312:fdbfb58d2735 src

added utility functions vm_get_title_ifo() and vm_ifo_close() to proxy dvdread functions to dvdnav proper. These functions are used in upcoming patch to describe the chapters of a title
author nicodvb
date Wed, 28 Nov 2007 23:13:50 +0000
parents 6631cb9daa01
children 152e19b2b6a1
files vm/vm.c vm/vm.h
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vm/vm.c	Sun Nov 11 11:57:34 2007 +0000
+++ b/vm/vm.c	Wed Nov 28 23:13:50 2007 +0000
@@ -1844,6 +1844,23 @@
   return pgcit;
 }
 
+//return the ifo_handle_t describing required title, used to 
+//identify chapters
+ifo_handle_t *vm_get_title_ifo(vm_t *vm, uint32_t title)
+{
+  ifo_handle_t *ifo = NULL;
+  uint8_t titleset_nr;
+  if((title < 1) || (title > vm->vmgi->tt_srpt->nr_of_srpts))
+    return NULL;
+  titleset_nr = vm->vmgi->tt_srpt->title[title-1].title_set_nr;
+  ifo = ifoOpen(vm->dvd, titleset_nr);
+  return ifo;
+}
+
+void vm_ifo_close(ifo_handle_t *ifo)
+{
+  ifoClose(ifo);
+}
 
 /* Debug functions */
 
--- a/vm/vm.h	Sun Nov 11 11:57:34 2007 +0000
+++ b/vm/vm.h	Wed Nov 28 23:13:50 2007 +0000
@@ -168,6 +168,8 @@
 video_attr_t vm_get_video_attr(vm_t *vm);
 audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN);
 subp_attr_t  vm_get_subp_attr(vm_t *vm, int streamN);
+ifo_handle_t *vm_get_title_ifo(vm_t *vm, uint32_t title);
+void vm_ifo_close(ifo_handle_t *ifo);
 
 /* Uncomment for VM command tracing */
 /* #define TRACE */