[vlc-commits] bluray: handle overlay in non-menu mode

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:03 2014 +0200| [f314ee2a18b57b9ed5aef823363ef4eca9beca73] | committer: Jean-Baptiste Kempf

bluray: handle overlay in non-menu mode

Required for BluRay text subtitle support.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f314ee2a18b57b9ed5aef823363ef4eca9beca73
---

 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 91c18f7..b6f1f96 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) {
@@ -1559,20 +1560,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);
             }
         }
     }



More information about the vlc-commits mailing list