diff options
Diffstat (limited to 'src/input/libdvdnav/navigation.c')
-rw-r--r-- | src/input/libdvdnav/navigation.c | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/src/input/libdvdnav/navigation.c b/src/input/libdvdnav/navigation.c index ba04b88c4..748cb7f52 100644 --- a/src/input/libdvdnav/navigation.c +++ b/src/input/libdvdnav/navigation.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: navigation.c,v 1.1 2002/08/08 17:49:21 richwareham Exp $ + * $Id: navigation.c,v 1.2 2002/09/04 11:07:47 mroi Exp $ * */ @@ -56,6 +56,7 @@ dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int *titles) { 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) { if(!this) return S_ERR; @@ -70,55 +71,34 @@ dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *this, int *programs) { return S_OK; } -dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) { - int num_titles; - - if(!this) { - return S_ERR; - } +dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int *title, int *part) { + if(!this || !this->vm) + return S_ERR; - /* Check number of titles */ - dvdnav_get_number_of_titles(this, &num_titles); - if((title > num_titles) || (title <= 0)) { - printerrf("Invalid title passed (%i, maximum %i)", title, - num_titles); + if(!title || !part) { + printerr("Passed a NULL pointer"); return S_ERR; } - - vm_start_title(this->vm, title); - return S_OK; + return vm_get_current_title_part(this->vm, title, part); } -dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int title, int part) { - int num_titles, num_progs; +dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) { if(!this) { return S_ERR; } - /* Check number of titles */ - dvdnav_get_number_of_titles(this, &num_titles); - if((title > num_titles) || (title <= 0)) { - printerrf("Invalid title passed (%i, maximum %i)", title, - num_titles); - return S_ERR; - } - - vm_start_title(this->vm, title); + return dvdnav_part_play(this, title, 1); +} +dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int title, int part) { - /* Check number of parts */ - num_progs = this->vm->state.pgc->nr_of_programs; - if((part > num_progs) || (part <= 0)) { - printerrf("Invalid program passed (%i, maximum %i)", part, - num_progs); + if(!this) { return S_ERR; } - - vm_jump_prog(this->vm, part); - - return S_OK; + + return vm_jump_title_part(this->vm, title, part); } dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int title, |