# HG changeset patch # User nicodvb # Date 1196291630 0 # Node ID fdbfb58d2735de55f70e92646c62d8b449c75e40 # Parent 6631cb9daa0146498f39b48d8e2608b664556095 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 diff -r 6631cb9daa01 -r fdbfb58d2735 vm/vm.c --- 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 */ diff -r 6631cb9daa01 -r fdbfb58d2735 vm/vm.h --- 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 */