# HG changeset patch # User jcdutton # Date 1032195281 0 # Node ID e7ebabe059b98f54541f7ddccefd9d29aeeb9a99 # Parent e29110f67f3a5a0ea8b556fd09c3142ff8fc22ff Start to get dvd mrl working in xine. diff -r e29110f67f3a -r e7ebabe059b9 dvdnav.h --- 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). diff -r e29110f67f3a -r e7ebabe059b9 navigation.c --- 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; }