[vlc-devel] [PATCH] bluray: simplify vout change detection

Petri Hintukainen phintuka at gmail.com
Fri Dec 11 13:59:54 CET 2015


---
 modules/access/bluray.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 58befce..388c08c 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -2076,18 +2076,6 @@ static void blurayHandleOverlays(demux_t *p_demux, int nread)
         if (display) {
             if (p_sys->p_vout == NULL)
                 p_sys->p_vout = input_GetVout(p_demux->p_input);
-            else {
-                /* track vout changes */
-                vout_thread_t *p_vout = input_GetVout(p_demux->p_input);
-                if (p_vout != p_sys->p_vout) {
-                    msg_Info(p_demux, "vout changed %p -> %p\n",
-                             (void *)p_sys->p_vout, (void *)p_vout);
-                    blurayReleaseVout(p_demux);
-                    p_sys->p_vout = p_vout;
-                } else {
-                    vlc_object_release(p_vout);
-                }
-            }
 
             /* NOTE: we might want to enable background video always when there's no video stream playing.
                Now, with some discs, there are perioids (even seconds) during which the video window
@@ -2119,8 +2107,16 @@ static int onIntfEvent( vlc_object_t *p_input, char const *psz_var,
 {
     (void)p_input; (void) psz_var; (void) oldval;
     demux_t *p_demux = p_data;
+    demux_sys_t *p_sys = p_demux->p_sys;
 
     if (val.i_int == INPUT_EVENT_VOUT) {
+
+        vlc_mutex_lock(&p_sys->bdj_overlay_lock);
+        if( p_sys->p_vout != NULL ) {
+            blurayReleaseVout(p_demux);
+        }
+        vlc_mutex_unlock(&p_sys->bdj_overlay_lock);
+
         blurayHandleOverlays(p_demux, 1);
     }
 
-- 
2.5.0



More information about the vlc-devel mailing list