Commit b1fa3292 authored by Laurent Aimar's avatar Laurent Aimar

* src/misc/objects.c: change the way that FIND_ANYWHERE work. Now we

 first search  the root of  the object  using p_parent and  not directly
 using p_vlc. If this first search  failed then we search using p_vlc if
 it wasn't the  case. (I'm not sure  it's harmless but I  think it's the
 correct behavour for FIND_ANYWHERE)

 * src/video_output/video_output.c  : we could now  use FIND_ANYWHERE to
 catch the  playlist (even when the  vlc is exiting. (Hehe, now visual
 effects won't reopen the vout every playlist item.)
parent 9befbcb9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling * objects.c: vlc_object_t handling
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: objects.c,v 1.39 2003/09/18 17:54:02 zorglub Exp $ * $Id: objects.c,v 1.40 2003/09/19 15:33:58 fenrir Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -426,8 +426,21 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode ) ...@@ -426,8 +426,21 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
/* Otherwise, recursively look for the object */ /* Otherwise, recursively look for the object */
if( (i_mode & 0x000f) == FIND_ANYWHERE ) if( (i_mode & 0x000f) == FIND_ANYWHERE )
{ {
p_found = FindObject( VLC_OBJECT(p_this->p_vlc), i_type, vlc_object_t *p_root = p_this;
(i_mode & ~0x000f) | FIND_CHILD );
/* Find the root */
while( p_root->p_parent != NULL &&
p_root != VLC_OBJECT( p_this->p_vlc ) )
{
p_root = p_root->p_parent;
}
p_found = FindObject( p_root, i_type, (i_mode & ~0x000f)|FIND_CHILD );
if( p_found == NULL && p_root != VLC_OBJECT( p_this->p_vlc ) )
{
p_found = FindObject( VLC_OBJECT( p_this->p_vlc ),
i_type, (i_mode & ~0x000f)|FIND_CHILD );
}
} }
else else
{ {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.235 2003/09/14 13:54:43 sigmunau Exp $ * $Id: video_output.c,v 1.236 2003/09/19 15:33:58 fenrir Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -81,7 +81,7 @@ vout_thread_t * __vout_Request ( vlc_object_t *p_this, vout_thread_t *p_vout, ...@@ -81,7 +81,7 @@ vout_thread_t * __vout_Request ( vlc_object_t *p_this, vout_thread_t *p_vout,
vlc_object_t *p_playlist; vlc_object_t *p_playlist;
p_playlist = vlc_object_find( p_this, p_playlist = vlc_object_find( p_this,
VLC_OBJECT_PLAYLIST, FIND_PARENT ); VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist ) if( p_playlist )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment