[vlc-devel] [PATCH 1/3] bluray: always handle all libbluray events
Petri Hintukainen
phintuka at users.sourceforge.net
Mon Feb 10 12:27:00 CET 2014
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.
---
modules/access/bluray.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index fdcf037..9db418a 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1535,6 +1535,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;
@@ -1542,8 +1546,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;
}
--
1.8.3.2
More information about the vlc-devel
mailing list