Skip to content

Commit

Permalink
bluray: handle libbluray error events
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
hpi1 authored and jbkempf committed Oct 6, 2015
1 parent 1a26c53 commit b238d8e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion modules/access/bluray.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ struct demux_sys_t

/* Menus */
bluray_overlay_t *p_overlays[MAX_OVERLAY];
bool b_fatal_error;
bool b_menu;
bool b_menu_open;
bool b_popup_available;
Expand Down Expand Up @@ -1771,6 +1772,22 @@ static void blurayHandleEvent(demux_t *p_demux, const BD_EVENT *e)
/* TODO: show / hide pop-up menu button in gui ? */
break;

/*
* Errors
*/
case BD_EVENT_ERROR:
/* fatal error (with menus) */
dialog_Fatal(p_demux, _("Blu-ray error"), "Playback with BluRay menus failed");
p_sys->b_fatal_error = true;
break;
case BD_EVENT_ENCRYPTED:
dialog_Fatal(p_demux, _("Blu-ray error"), "This disc seems to be encrypted");
p_sys->b_fatal_error = true;
break;
case BD_EVENT_READ_ERROR:
msg_Err(p_demux, "bluray: read error\n");
break;

/*
* stream selection events
*/
Expand Down Expand Up @@ -1899,8 +1916,10 @@ static int blurayDemux(demux_t *p_demux)

if (nread <= 0) {
block_Release(p_block);
if (nread < 0)
if (p_sys->b_fatal_error || nread < 0) {
msg_Err(p_demux, "bluray: stopping playback after fatal error\n");
return VLC_DEMUXER_EGENERIC;
}
return VLC_DEMUXER_SUCCESS;
}

Expand Down

0 comments on commit b238d8e

Please sign in to comment.