comparison searching.c @ 269:77e472cef5f8 src

implemented dvdnav_get_current_time() with obvious meaning
author nicodvb
date Sun, 08 Apr 2007 17:45:19 +0000
parents 99d33725395d
children 5d091ebc4c3b
comparison
equal deleted inserted replaced
268:5256576e85cd 269:77e472cef5f8
120 pthread_mutex_unlock(&this->vm_lock); 120 pthread_mutex_unlock(&this->vm_lock);
121 return DVDNAV_STATUS_ERR; 121 return DVDNAV_STATUS_ERR;
122 } 122 }
123 123
124 124
125 this->cur_cell_time = 0;
125 if (this->pgc_based) { 126 if (this->pgc_based) {
126 first_cell_nr = 1; 127 first_cell_nr = 1;
127 last_cell_nr = state->pgc->nr_of_cells; 128 last_cell_nr = state->pgc->nr_of_cells;
128 } else { 129 } else {
129 /* Find start cell of program. */ 130 /* Find start cell of program. */
240 printerr("Illegal seek mode."); 241 printerr("Illegal seek mode.");
241 pthread_mutex_unlock(&this->vm_lock); 242 pthread_mutex_unlock(&this->vm_lock);
242 return DVDNAV_STATUS_ERR; 243 return DVDNAV_STATUS_ERR;
243 } 244 }
244 245
246 this->cur_cell_time = 0;
245 if (this->pgc_based) { 247 if (this->pgc_based) {
246 first_cell_nr = 1; 248 first_cell_nr = 1;
247 last_cell_nr = state->pgc->nr_of_cells; 249 last_cell_nr = state->pgc->nr_of_cells;
248 } else { 250 } else {
249 /* Find start cell of program. */ 251 /* Find start cell of program. */
326 fprintf(MSG_OUT, "libdvdnav: previous chapter failed.\n"); 328 fprintf(MSG_OUT, "libdvdnav: previous chapter failed.\n");
327 printerr("Skip to previous chapter failed."); 329 printerr("Skip to previous chapter failed.");
328 pthread_mutex_unlock(&this->vm_lock); 330 pthread_mutex_unlock(&this->vm_lock);
329 return DVDNAV_STATUS_ERR; 331 return DVDNAV_STATUS_ERR;
330 } 332 }
333 this->cur_cell_time = 0;
331 this->position_current.still = 0; 334 this->position_current.still = 0;
332 this->vm->hop_channel++; 335 this->vm->hop_channel++;
333 #ifdef LOG_DEBUG 336 #ifdef LOG_DEBUG
334 fprintf(MSG_OUT, "libdvdnav: previous chapter done\n"); 337 fprintf(MSG_OUT, "libdvdnav: previous chapter done\n");
335 #endif 338 #endif
359 fprintf(MSG_OUT, "libdvdnav: top chapter failed.\n"); 362 fprintf(MSG_OUT, "libdvdnav: top chapter failed.\n");
360 printerr("Skip to top chapter failed."); 363 printerr("Skip to top chapter failed.");
361 pthread_mutex_unlock(&this->vm_lock); 364 pthread_mutex_unlock(&this->vm_lock);
362 return DVDNAV_STATUS_ERR; 365 return DVDNAV_STATUS_ERR;
363 } 366 }
367 this->cur_cell_time = 0;
364 this->position_current.still = 0; 368 this->position_current.still = 0;
365 this->vm->hop_channel++; 369 this->vm->hop_channel++;
366 #ifdef LOG_DEBUG 370 #ifdef LOG_DEBUG
367 fprintf(MSG_OUT, "libdvdnav: top chapter done\n"); 371 fprintf(MSG_OUT, "libdvdnav: top chapter done\n");
368 #endif 372 #endif
402 printerr("Skip to next chapter failed."); 406 printerr("Skip to next chapter failed.");
403 pthread_mutex_unlock(&this->vm_lock); 407 pthread_mutex_unlock(&this->vm_lock);
404 return DVDNAV_STATUS_ERR; 408 return DVDNAV_STATUS_ERR;
405 } 409 }
406 } 410 }
411 this->cur_cell_time = 0;
407 /* merge changes on success */ 412 /* merge changes on success */
408 vm_merge(this->vm, try_vm); 413 vm_merge(this->vm, try_vm);
409 vm_free_copy(try_vm); 414 vm_free_copy(try_vm);
410 this->position_current.still = 0; 415 this->position_current.still = 0;
411 this->vm->hop_channel++; 416 this->vm->hop_channel++;
430 printerr("No current PGC."); 435 printerr("No current PGC.");
431 pthread_mutex_unlock(&this->vm_lock); 436 pthread_mutex_unlock(&this->vm_lock);
432 return DVDNAV_STATUS_ERR; 437 return DVDNAV_STATUS_ERR;
433 } 438 }
434 439
440 this->cur_cell_time = 0;
435 /* make a copy of current VM and try to navigate the copy to the menu */ 441 /* make a copy of current VM and try to navigate the copy to the menu */
436 try_vm = vm_new_copy(this->vm); 442 try_vm = vm_new_copy(this->vm);
437 if ( (menu == DVD_MENU_Escape) && (this->vm->state.domain != VTS_DOMAIN)) { 443 if ( (menu == DVD_MENU_Escape) && (this->vm->state.domain != VTS_DOMAIN)) {
438 /* Try resume */ 444 /* Try resume */
439 if (vm_jump_resume(try_vm) && !try_vm->stopped) { 445 if (vm_jump_resume(try_vm) && !try_vm->stopped) {