From 8e7cf6314d72cf52901d876fc2cacb42db3b331e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20Stenac?= Date: Sun, 12 Feb 2006 15:28:56 +0000 Subject: [PATCH] Fix refcount problems --- modules/control/hotkeys.c | 11 +++++++++-- modules/gui/skins2/src/vlcproc.cpp | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c index 9e09839251..b84671974b 100644 --- a/modules/control/hotkeys.c +++ b/modules/control/hotkeys.c @@ -206,8 +206,15 @@ static void Run( intf_thread_t *p_intf ) /* Update the input */ if( p_intf->p_sys->p_input == NULL ) { - p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, - FIND_ANYWHERE ); + p_playlist = (playlist_t *)vlc_object_find( p_intf, + VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); + if( p_playlist ) + { + p_intf->p_sys->p_input = p_playlist->p_input; + if( p_intf->p_sys->p_input ) + vlc_object_yield( p_intf->p_sys->p_input ); + vlc_object_release( p_playlist ); + } } else if( p_intf->p_sys->p_input->b_dead ) { diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp index ee0840c28b..8f2d815c98 100644 --- a/modules/gui/skins2/src/vlcproc.cpp +++ b/modules/gui/skins2/src/vlcproc.cpp @@ -240,8 +240,9 @@ void VlcProc::manage() // Update the input if( getIntf()->p_sys->p_input == NULL ) { - getIntf()->p_sys->p_input = (input_thread_t *)vlc_object_find( - getIntf(), VLC_OBJECT_INPUT, FIND_ANYWHERE ); + getIntf()->p_sys->p_input = getIntf()->p_sys->p_playlist->p_input; + if( getIntf()->p_sys->p_input ) + vlc_object_yield( getIntf()->p_sys->p_input ); } else if( getIntf()->p_sys->p_input->b_dead ) { -- 2.39.2