[vlc-commits] bluray: always handle all libbluray events
Petri Hintukainen
git at videolan.org
Mon Feb 10 16:07:04 CET 2014
vlc | branch: master | Petri Hintukainen <phintuka at users.sourceforge.net> | Mon Feb 10 13:27:00 2014 +0200| [a799b4d6e6f67647507df2236e020c4e93d3ec7e] | committer: 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: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a799b4d6e6f67647507df2236e020c4e93d3ec7e
---
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 9edf4d1..652ba6f 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -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;
}
More information about the vlc-commits
mailing list