Commit 8b866642 authored by hpi1's avatar hpi1

Check movie object title search and menu call masks before allowing user operation

parent 8d5e5ff0
......@@ -1875,6 +1875,13 @@ int bd_play_title(BLURAY *bd, unsigned title)
return 0;
}
if (bd->title_type == title_hdmv) {
if (hdmv_vm_get_uo_mask(bd->hdmv_vm) & HDMV_TITLE_SEARCH_MASK) {
BD_DEBUG(DBG_BLURAY|DBG_CRIT, "title search masked by movie object\n");
return 0;
}
}
return _play_title(bd, title);
}
......@@ -1889,6 +1896,13 @@ int bd_menu_call(BLURAY *bd, int64_t pts)
return 0;
}
if (bd->title_type == title_hdmv) {
if (hdmv_vm_get_uo_mask(bd->hdmv_vm) & HDMV_MENU_CALL_MASK) {
BD_DEBUG(DBG_BLURAY|DBG_CRIT, "menu call masked by movie object\n");
return 0;
}
}
return _play_title(bd, BLURAY_TITLE_TOP_MENU);
}
......
......@@ -947,6 +947,22 @@ int hdmv_vm_running(HDMV_VM *p)
return result;
}
uint32_t hdmv_vm_get_uo_mask(HDMV_VM *p)
{
uint32_t mask = 0;
MOBJ_OBJECT *o = NULL;
bd_mutex_lock(&p->mutex);
if ((o = p->object ? p->object : p->suspended_object)) {
mask |= o->menu_call_mask;
mask |= o->title_search_mask << 1;
}
bd_mutex_unlock(&p->mutex);
return mask;
}
int hdmv_vm_resume(HDMV_VM *p)
{
int result;
......
......@@ -74,6 +74,11 @@ BD_PRIVATE int hdmv_vm_run(HDMV_VM *p, HDMV_EVENT *ev);
BD_PRIVATE int hdmv_vm_get_event(HDMV_VM *p, HDMV_EVENT *ev);
BD_PRIVATE int hdmv_vm_running(HDMV_VM *p);
#define HDMV_MENU_CALL_MASK 0x01
#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);
BD_PRIVATE int hdmv_vm_resume(HDMV_VM *p);
......
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