Commit 60c023f3 authored by hpi1's avatar hpi1

HDMV: detect infinite looping between graphics controller and HDMV VM

Fixes live lock with "Butterfly on the Wheel" by aborting playback.
The disc is broken:
UO mask allows jumping to root menu from language selection menu.
This skips on-disc menu initialization code, causing infinite loop
in root menu.
parent e73add92
- Fix infinite loop with some broken HDMV menus
2015-01-26: Version 0.7.0
- Add player setting for BD-J persistent storage and cache paths.
- Add support for system fonts. BD-J fonts in jre/lib/fonts/ are not required anymore.
......
......@@ -3169,6 +3169,7 @@ static int _read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
/* run HDMV VM ? */
if (bd->title_type == title_hdmv) {
int loops = 0;
while (!bd->hdmv_suspended) {
if (_run_hdmv(bd) < 0) {
......@@ -3176,6 +3177,16 @@ static int _read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
bd->title_type = title_undef;
return -1;
}
if (loops++ > 100) {
/* Detect infinite loops.
* Broken disc may cause infinite loop between graphics controller and HDMV VM.
* This happens ex. with "Butterfly on a Wheel":
* Triggering unmasked "Menu Call" UO in language selection menu skips
* menu system initialization code, resulting in infinite loop in root menu.
*/
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_read_ext(): detected possible HDMV mode live lock (%d loops)\n", loops);
_queue_event(bd, BD_EVENT_ERROR, BD_ERROR_HDMV);
}
if (_get_event(bd, event)) {
return 0;
}
......
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