[vlc-devel] commit: Warn when pl_Yield() is not used ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue May 27 17:51:03 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Tue May 27 18:52:39 2008 +0300| [1c8c942251d1dbd4fe88134e4b1571da25ea4e41]

Warn when pl_Yield() is not used

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

 src/misc/objects.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 452f52d..043fd9e 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -710,17 +710,21 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
         return p_this;
     }
 
-    vlc_mutex_lock( &structure_lock );
-
     /* Otherwise, recursively look for the object */
-    if( (i_mode & 0x000f) == FIND_ANYWHERE )
-        p_found = FindObject( p_this->p_libvlc, i_type,
-                              (i_mode & ~0x000f)|FIND_CHILD );
-    else
-        p_found = FindObject( p_this, i_type, i_mode );
+    if ((i_mode & 0x000f) == FIND_ANYWHERE)
+    {
+#ifndef NDEBUG
+        if (i_type == VLC_OBJECT_PLAYLIST)
+	    msg_Warn (p_this, "using vlc_object_find(VLC_OBJECT_PLAYLIST) "
+                      "instead of pl_Yield()");
+#endif
+        return vlc_object_find (p_this->p_libvlc, i_type,
+                                (i_mode & ~0x000f)|FIND_CHILD);
+    }
 
+    vlc_mutex_lock( &structure_lock );
+    p_found = FindObject( p_this, i_type, i_mode );
     vlc_mutex_unlock( &structure_lock );
-
     return p_found;
 }
 




More information about the vlc-devel mailing list