Mercurial > libdvdnav.hg
changeset 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 | 2fcb4f228308 |
files | dvdnav.h navigation.c |
diffstat | 2 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/dvdnav.h Mon Sep 16 16:27:18 2002 +0000 +++ b/dvdnav.h Mon Sep 16 16:54:41 2002 +0000 @@ -275,9 +275,10 @@ * Returns the number of programs within the current title. * * \param self Pointer to dvdnav_t associated with this operation. - * \param programs Pointer to int to receive number of programs. + * \param titles int to select title. + * \param parts Pointer to int to receive number of parts. */ -dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *self, int *programs); +dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *self, int title, int *parts); /** * If we are currently in a still-frame this function skips it (or attempts to).
--- 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; }