]> git.sesse.net Git - vlc/commitdiff
Do not allow input to be found as a child, decoder/generic at all
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 18 Jan 2010 18:03:34 +0000 (20:03 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 18 Jan 2010 18:12:44 +0000 (20:12 +0200)
This is not needed, and not a good idea.

src/misc/objects.c

index 5afc444bca58ba7dd3bda8d7f18e11ffbe8b4cf1..c904a0d0bfca51fc8e83ab4e350ec69468cc95bf 100644 (file)
@@ -452,6 +452,21 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
     if (i_mode == FIND_ANYWHERE)
         return vlc_object_find (p_this->p_libvlc, i_type, FIND_CHILD);
 
+    switch (i_type)
+    {
+        case VLC_OBJECT_VOUT:
+        case VLC_OBJECT_AOUT:
+            break;
+        case VLC_OBJECT_INPUT:
+            /* input can only be accessed like this from children,
+             * otherwise we could not promise that it is initialized */
+            if (i_mode != FIND_PARENT)
+                return NULL;
+            break;
+        default:
+            return NULL;
+    }
+
     libvlc_lock (p_this->p_libvlc);
     p_found = FindObject( p_this, i_type, i_mode );
     libvlc_unlock (p_this->p_libvlc);