Index: libdvdnav/src/vm/vm.c =================================================================== --- libdvdnav/src/vm/vm.c (revision 1217) +++ libdvdnav/src/vm/vm.c (working copy) @@ -100,6 +100,7 @@ static pgcit_t* get_MENU_PGCIT(vm_t *vm, ifo_handle_t *h, uint16_t lang); static pgcit_t* get_PGCIT(vm_t *vm); +static void vm_close(vm_t *vm); /* Helper functions */ @@ -268,7 +269,7 @@ } void vm_free_vm(vm_t *vm) { - vm_stop(vm); + vm_close(vm); free(vm); } @@ -295,12 +296,20 @@ int vm_start(vm_t *vm) { /* Set pgc to FP (First Play) pgc */ + if (vm->stopped) { + vm_reset(vm, NULL); + vm->stopped = 0; + } set_FP_PGC(vm); process_command(vm, play_PGC(vm)); return !vm->stopped; } void vm_stop(vm_t *vm) { + vm->stopped = 1; +} + +static void vm_close(vm_t *vm) { if(vm->vmgi) { ifoClose(vm->vmgi); vm->vmgi=NULL; @@ -352,7 +361,7 @@ if (vm->dvd && dvdroot) { /* a new dvd device has been requested */ - vm_stop(vm); + vm_close(vm); } if (!vm->dvd) { vm->dvd = DVDOpen(dvdroot);