[vlc-devel] commit: Do not recycle video outputs - fixes #1651 ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Jul 1 18:50:50 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Jul  1 19:42:23 2008 +0300| [127a867bc75e3688f0de69f9abb2ae41dc28faaf]

Do not recycle video outputs - fixes #1651

For the same reason as audio outputs. The code was thread-unsafe beyond
repair.

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

 src/video_output/video_output.c |   25 +++++--------------------
 1 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 172f5fc..af8fe77 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -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 )




More information about the vlc-devel mailing list