]> git.sesse.net Git - vlc/commitdiff
Do not recycle video outputs - fixes #1651
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 1 Jul 2008 16:42:23 +0000 (19:42 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 1 Jul 2008 16:47:38 +0000 (19:47 +0300)
For the same reason as audio outputs. The code was thread-unsafe beyond
repair.

src/video_output/video_output.c

index 172f5fca20afbbdfa989b47b07dfa7bb65042d68..af8fe775c0a360e5b02e8076edd325296425c18e 100644 (file)
@@ -125,12 +125,13 @@ vout_thread_t *__vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
 {
     if( !p_fmt )
     {
-        /* Reattach video output to the instance before bailing out */
+        /* Video output is no longer used.
+         * TODO: support for reusing video outputs with proper _thread-safe_
+         * reference handling. */
         if( p_vout )
         {
             spu_Attach( p_vout->p_spu, p_this, false );
-            vlc_object_detach( p_vout );
-            vlc_object_attach( p_vout, p_this->p_libvlc );
+            vlc_object_release( p_vout );
         }
         return NULL;
     }
@@ -140,24 +141,8 @@ vout_thread_t *__vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
     {
         vlc_object_yield( p_vout );
     }
-    else
-    {
-        p_vout = vlc_object_find( p_this, VLC_OBJECT_VOUT, FIND_CHILD );
 
-        if( !p_vout )
-        {
-            p_vout = vlc_object_find( p_this->p_libvlc,
-                                      VLC_OBJECT_VOUT, FIND_CHILD );
-            /* only first children of p_input for unused vout */
-            if( p_vout && p_vout->p_parent != VLC_OBJECT(p_this->p_libvlc) )
-            {
-                vlc_object_release( p_vout );
-                p_vout = NULL;
-            }
-            if( p_vout )
-                vlc_object_detach( p_vout );    /* Remove it from the GC */
-        }
-    }
+    /* TODO: find a suitable unused video output */
 
     /* If we now have a video output, check it has the right properties */
     if( p_vout )