[vlc-devel] [PATCH 2/3] bluray: handle overlay in non-menu mode

Petri Hintukainen phintuka at users.sourceforge.net
Mon Feb 10 11:53:22 CET 2014


Required for BluRay text subtitle support.
---
 modules/access/bluray.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 9db418a..1544d64 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -389,6 +389,9 @@ static int blurayOpen(vlc_object_t *object)
      */
     bd_get_event(p_sys->bluray, NULL);
 
+    /* Registering overlay event handler */
+    bd_register_overlay_proc(p_sys->bluray, p_demux, blurayOverlayProc);
+
     if (p_sys->b_menu) {
         p_sys->p_input = demux_GetParentInput(p_demux);
         if (unlikely(!p_sys->p_input)) {
@@ -404,8 +407,6 @@ static int blurayOpen(vlc_object_t *object)
         if (bd_play(p_sys->bluray) == 0)
             BLURAY_ERROR(_("Failed to start bluray playback. Please try without menu support."));
 
-        /* Registering overlay event handler */
-        bd_register_overlay_proc(p_sys->bluray, p_demux, blurayOverlayProc);
     } else {
         /* set start title number */
         if (bluraySetTitle(p_demux, p_sys->i_longest_title) != VLC_SUCCESS) {
@@ -1549,20 +1550,20 @@ static int blurayDemux(demux_t *p_demux)
             block_Release(p_block);
             return 1;
         }
+    }
 
-        if (p_sys->current_overlay != -1) {
-            bluray_overlay_t *ov = p_sys->p_overlays[p_sys->current_overlay];
-            vlc_mutex_lock(&ov->lock);
-            bool display = ov->status == ToDisplay;
-            vlc_mutex_unlock(&ov->lock);
-            if (display) {
-                if (p_sys->p_vout == NULL)
-                    p_sys->p_vout = input_GetVout(p_sys->p_input);
-                if (p_sys->p_vout != NULL) {
-                    var_AddCallback(p_sys->p_vout, "mouse-moved", onMouseEvent, p_demux);
-                    var_AddCallback(p_sys->p_vout, "mouse-clicked", onMouseEvent, p_demux);
-                    bluraySendOverlayToVout(p_demux);
-                }
+    if (p_sys->current_overlay != -1) {
+        bluray_overlay_t *ov = p_sys->p_overlays[p_sys->current_overlay];
+        vlc_mutex_lock(&ov->lock);
+        bool display = ov->status == ToDisplay;
+        vlc_mutex_unlock(&ov->lock);
+        if (display) {
+            if (p_sys->p_vout == NULL)
+                p_sys->p_vout = input_GetVout(p_sys->p_input);
+            if (p_sys->p_vout != NULL) {
+                var_AddCallback(p_sys->p_vout, "mouse-moved", onMouseEvent, p_demux);
+                var_AddCallback(p_sys->p_vout, "mouse-clicked", onMouseEvent, p_demux);
+                bluraySendOverlayToVout(p_demux);
             }
         }
     }
-- 
1.8.3.2




More information about the vlc-devel mailing list