Commit a799b4d6 authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

bluray: always handle all libbluray events

Events can be returned even if read returns <= 0.
Single bd_read_ext() call can trigger multiple events.
All events should be handled before next bd_read_ext() call,
events are tied to current read position.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9e10f3fb
......@@ -1540,6 +1540,10 @@ static int blurayDemux(demux_t *p_demux)
} else {
nread = bd_read_ext(p_sys->bluray, p_block->p_buffer,
NB_TS_PACKETS * BD_TS_PACKET_SIZE, &e);
while (e.event != BD_EVENT_NONE) {
blurayHandleEvent(p_demux, &e);
bd_get_event(p_sys->bluray, &e);
}
if (nread < 0) {
block_Release(p_block);
return -1;
......@@ -1547,8 +1551,6 @@ static int blurayDemux(demux_t *p_demux)
if (nread == 0) {
if (e.event == BD_EVENT_NONE)
msg_Info(p_demux, "We reached the end of a title");
else
blurayHandleEvent(p_demux, &e);
block_Release(p_block);
return 1;
}
......
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