[vlc-devel] commit: Warn about vlc_object_get ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat May 31 12:47:13 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat May 31 13:38:12 2008 +0300| [792c8ca37fbac2707af4eb695f231c3d70284a92]

Warn about vlc_object_get

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

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

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 8e4c487..1df7b60 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -647,6 +647,13 @@ void * vlc_object_get( int i_id )
 {
     libvlc_global_data_t *p_libvlc_global = vlc_global();
     vlc_object_t *obj = NULL;
+    vlc_object_t *caller = vlc_threadobj ();
+
+    if (caller)
+        msg_Dbg (caller, "uses deprecated vlc_object_get(%d)", i_id);
+    else
+        fprintf (stderr, "main thread uses deprecated vlc_object_get(%d)\n",
+                 i_id);
 
     vlc_mutex_lock( &structure_lock );
 
@@ -661,7 +668,10 @@ void * vlc_object_get( int i_id )
         }
     }
     obj = NULL;
-
+    if (caller)
+        msg_Warn (caller, "wants non-existing object %d", i_id);
+    else
+        fprintf (stderr, "main thread wants non-existing object %d\n", i_id);
 out:
     vlc_mutex_unlock( &structure_lock );
     return obj;




More information about the vlc-devel mailing list