Commit d50758ed authored by hpi1's avatar hpi1

Store current playback location when entering top menu

parent 8b43eb22
......@@ -1938,6 +1938,10 @@ int bd_menu_call(BLURAY *bd, int64_t pts)
BD_DEBUG(DBG_BLURAY|DBG_CRIT, "menu call masked by movie object\n");
return 0;
}
if (hdmv_vm_suspend_pl(bd->hdmv_vm) < 0) {
BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_menu_call(): error storing playback location\n");
}
}
return _play_title(bd, BLURAY_TITLE_TOP_MENU);
......
......@@ -974,13 +974,25 @@ int hdmv_vm_resume(HDMV_VM *p)
return result;
}
int hdmv_vm_suspend(HDMV_VM *p)
int hdmv_vm_suspend_pl(HDMV_VM *p)
{
int result = -1;
bd_mutex_lock(&p->mutex);
if (p->object && !p->ig_object) {
_suspend_object(p, 1);
if (p->object || p->ig_object) {
BD_DEBUG(DBG_HDMV, "hdmv_vm_suspend_pl(): HDMV VM is still running\n");
} else if (!p->suspended_object) {
BD_DEBUG(DBG_HDMV, "hdmv_vm_suspend_pl(): No suspended object\n");
} else if (!p->suspended_object->resume_intention_flag) {
BD_DEBUG(DBG_HDMV, "hdmv_vm_suspend_pl(): no resume intention flag\n");
p->suspended_object = NULL;
result = 0;
} else {
bd_psr_save_state(p->regs);
result = 0;
}
......
......@@ -79,7 +79,35 @@ BD_PRIVATE int hdmv_vm_running(HDMV_VM *p);
#define HDMV_TITLE_SEARCH_MASK 0x02
BD_PRIVATE uint32_t hdmv_vm_get_uo_mask(HDMV_VM *p);
BD_PRIVATE int hdmv_vm_suspend(HDMV_VM *p);
/**
*
* Suspend playlist playback
*
* This function assumes playlist is currently playing and
* movie object execution is suspended at PLAY_PL instruction.
*
* If resume_intention_flag of current movie object is 1:
* Copy playback position PSRs to backup registers
* (suspend playlist playback at current position)
* If resume_intention_flag of current movie object is 0:
* Discard current movie object
*
* @param p HDMV_VM object
* @return 0 on success, -1 if error
*/
BD_PRIVATE int hdmv_vm_suspend_pl(HDMV_VM *p);
/**
*
* Resume HDMV execution
*
* Continue execution of movie object after playlist playback.
* Do not restore backup PSRs.
* This function is called when playlist playback ends.
*
* @param p HDMV_VM object
* @return 0 on success, -1 if error
*/
BD_PRIVATE int hdmv_vm_resume(HDMV_VM *p);
#endif // _HDMV_VM_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment