diff navigation.c @ 22:3c1df0cb3aee src

Start of rewrite of libdvdnav. Still need to re-implement seeking.
author jcdutton
date Mon, 22 Apr 2002 22:01:28 +0000
parents c1b55dc1bfed
children c2d40c38e12f
line wrap: on
line diff
--- a/navigation.c	Mon Apr 22 20:57:15 2002 +0000
+++ b/navigation.c	Mon Apr 22 22:01:28 2002 +0000
@@ -33,27 +33,27 @@
 /* Navigation API calls */
 
 /* Common things we do everytime we do a jump */
-void dvdnav_do_post_jump(dvdnav_t *self) {
-  dvd_state_t *state = &(self->vm->state);
+void dvdnav_do_post_jump(dvdnav_t *this) {
+  dvd_state_t *state = &(this->vm->state);
   cell_playback_t *cell = &(state->pgc->cell_playback[state->cellN - 1]);
 
-  self->jmp_blockN = 0; /* FIXME: Should this be different? */
-  self->jmp_vobu_start = cell->first_sector;
-  self->jumping = 1;
-  self->still_frame = -1;
+  this->jmp_blockN = 0; /* FIXME: Should this be different? */
+  this->jmp_vobu_start = cell->first_sector;
+  this->jumping = 1;
+  this->position_current.still = 0;
 }
 
-dvdnav_status_t dvdnav_still_skip(dvdnav_t *self) {
-  if(!self)
+dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) {
+  if(!this)
    return S_ERR;
 
-  self->still_frame = -1;
+  this->position_current.still = 0;
 
   return S_OK;
 }
 
-dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int *titles) {
-  if(!self)
+dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int *titles) {
+  if(!this)
    return S_ERR;
 
   if(!titles) {
@@ -61,13 +61,13 @@
     return S_ERR;
   }
 
-  (*titles) = vm_get_vmgi(self->vm)->tt_srpt->nr_of_srpts;
+  (*titles) = vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts;
 
   return S_OK;
 }
 
-dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *self, int *programs) {
-  if(!self)
+dvdnav_status_t dvdnav_get_number_of_programs(dvdnav_t *this, int *programs) {
+  if(!this)
    return S_ERR;
 
   if(!programs) {
@@ -75,107 +75,107 @@
     return S_ERR;
   }
 
-  (*programs) = self->vm->state.pgc->nr_of_programs;
+  (*programs) = this->vm->state.pgc->nr_of_programs;
 
   return S_OK;
 }
 
-dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int title) {
+dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) {
   int num_titles;
 
-  if(!self) {
+  if(!this) {
     return S_ERR;
   }
 
   /* Check number of titles */
-  dvdnav_get_number_of_titles(self, &num_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(self->vm, title);
+  vm_start_title(this->vm, title);
 
-  /* self->expecting_nav_packet = 1; */
+  /* this->expecting_nav_packet = 1; */
 
-  dvdnav_do_post_jump(self);
+  dvdnav_do_post_jump(this);
 
   return S_OK;
 }
 
-dvdnav_status_t dvdnav_part_play(dvdnav_t *self, int title, int part) {
+dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int title, int part) {
   int num_titles, num_progs;
 
-  if(!self) {
+  if(!this) {
     return S_ERR;
   }
 
   /* Check number of titles */
-  dvdnav_get_number_of_titles(self, &num_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(self->vm, title);
+  vm_start_title(this->vm, title);
 
 
   /* Check number of parts */
-  num_progs = self->vm->state.pgc->nr_of_programs;
+  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);
     return S_ERR;
   }
    
-  vm_jump_prog(self->vm, part);
+  vm_jump_prog(this->vm, part);
   
-   /* self->expecting_nav_packet = 1; */
+   /* this->expecting_nav_packet = 1; */
 
-  dvdnav_do_post_jump(self);
+  dvdnav_do_post_jump(this);
 
   return S_OK;
 }
 
-dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int title,
+dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int title,
 					  int part, int parts_to_play) {
   /* Perform jump as per usual */
 
-  return dvdnav_part_play(self, title, part);
+  return dvdnav_part_play(this, title, part);
   
   /* FIXME: Impement auto-stop */
   
   /* return S_OK;*/ 
 }
 
-dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int title,
+dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int title,
 				unsigned long int time) {
   /* FIXME: Implement */
   
   return S_OK;
 }
 
-dvdnav_status_t dvdnav_stop(dvdnav_t *self) {
-  if(!self)
+dvdnav_status_t dvdnav_stop(dvdnav_t *this) {
+  if(!this)
    return S_ERR;
 
   /* Set the STOP flag */
   
-  self->stop = 1;
+  this->stop = 1;
   
   return S_OK;
 }
 
-dvdnav_status_t dvdnav_go_up(dvdnav_t *self) {
-  if(!self)
+dvdnav_status_t dvdnav_go_up(dvdnav_t *this) {
+  if(!this)
    return S_ERR;
 
   /* A nice easy function... delegate to the VM */
-  vm_go_up(self->vm);
+  vm_go_up(this->vm);
 
-  dvdnav_do_post_jump(self);
+  dvdnav_do_post_jump(this);
 
   return S_OK;
 }