[vlc-commits] bluray: fix disappearing of overlays

Rafaël Carré git at videolan.org
Fri Aug 16 13:26:12 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Thu Aug 15 16:18:45 2013 +0200| [1eba944c00490701a2ef2fa3075650ae784c858b] | committer: Rafaël Carré

bluray: fix disappearing of overlays

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

 modules/access/bluray.c |   28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 9f3f55b..6846e34 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -751,26 +751,20 @@ static void blurayCloseOverlay(demux_t *p_demux, int plane)
     bluray_overlay_t *ov = p_sys->p_overlays[plane];
 
     if (ov != NULL) {
-        vout_FlushSubpictureChannel(p_sys->p_vout, ov->p_pic->i_channel);
+        if (p_sys->p_vout)
+            vout_FlushSubpictureChannel(p_sys->p_vout, ov->p_pic->i_channel);
         blurayCleanOverlayStruct(ov);
         if (p_sys->current_overlay == plane)
             p_sys->current_overlay = -1;
-    }
-
-    p_sys->p_overlays[plane] = NULL;
-}
-
-static void blurayCloseAllOverlays(demux_t *p_demux)
-{
-    demux_sys_t *p_sys = p_demux->p_sys;
 
-    p_demux->p_sys->current_overlay = -1;
-    if (!p_sys->p_vout)
-        return;
+        p_sys->p_overlays[plane] = NULL;
+    }
 
     for (int i = 0; i < MAX_OVERLAY; i++)
-        blurayCloseOverlay(p_demux, i);
+        if (p_sys->p_overlays[i])
+            return;
 
+    /* All overlays have been closed */
     var_DelCallback(p_sys->p_vout, "mouse-moved", onMouseEvent, p_demux);
     var_DelCallback(p_sys->p_vout, "mouse-clicked", onMouseEvent, p_demux);
     vlc_object_release(p_sys->p_vout);
@@ -941,10 +935,14 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
 static void blurayOverlayProc(void *ptr, const BD_OVERLAY *const overlay)
 {
     demux_t *p_demux = (demux_t*)ptr;
+    demux_sys_t *p_sys = p_demux->p_sys;
 
     if (!overlay) {
-        msg_Info(p_demux, "Closing overlay.");
-        blurayCloseAllOverlays(p_demux);
+        msg_Info(p_demux, "Closing overlays.");
+        p_sys->current_overlay = -1;
+        if (p_sys->p_vout)
+            for (int i = 0; i < MAX_OVERLAY; i++)
+                blurayCloseOverlay(p_demux, i);
         return;
     }
 



More information about the vlc-commits mailing list