Commit 7060dbb9 authored by dionoea's avatar dionoea
Browse files

s/vlc_object_yield/vlc_object_release/

As discussed on IRC. Yield was quite confusing.
parent e6103805
......@@ -84,7 +84,7 @@ __attribute__((deprecated))
#endif
VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) );
VLC_EXPORT( void *, __vlc_object_yield, ( vlc_object_t * ) );
VLC_EXPORT( void *, __vlc_object_hold, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( vlc_list_t *, __vlc_list_children, ( vlc_object_t * ) );
......@@ -110,8 +110,8 @@ VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
#define vlc_object_find_name(a,b,c) \
vlc_object_find_name( VLC_OBJECT(a),b,c)
#define vlc_object_yield(a) \
(typeof(a))__vlc_object_yield( VLC_OBJECT(a) )
#define vlc_object_hold(a) \
(typeof(a))__vlc_object_hold( VLC_OBJECT(a) )
#define vlc_object_release(a) \
__vlc_object_release( VLC_OBJECT(a) )
......
......@@ -322,7 +322,7 @@ DBUS_METHOD( Play )
PL_LOCK;
input_thread_t *p_input = p_playlist->p_input;
if( p_input )
vlc_object_yield( p_input );
vlc_object_hold( p_input );
PL_UNLOCK;
if( p_input )
......@@ -807,7 +807,7 @@ static void Close ( vlc_object_t *p_this )
p_input = p_playlist->p_input;
if ( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
var_DelCallback( p_input, "state", StateChange, p_intf );
vlc_object_release( p_input );
}
......@@ -1006,7 +1006,7 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var,
return VLC_SUCCESS;
}
vlc_object_yield( p_input );
vlc_object_hold( p_input );
pl_Release( p_intf );
p_item = input_GetItem( p_input );
......
......@@ -144,7 +144,7 @@ static input_thread_t * input_from_playlist ( playlist_t *p_playlist )
PL_LOCK;
p_input = p_playlist->p_input;
if( p_input )
vlc_object_yield( p_input );
vlc_object_hold( p_input );
PL_UNLOCK;
return p_input;
......
......@@ -177,7 +177,7 @@ static void Run( intf_thread_t *p_intf )
PL_LOCK;
p_input = p_playlist->p_input;
if( p_input )
vlc_object_yield( p_input );
vlc_object_hold( p_input );
PL_UNLOCK;
/* Update the vout */
......
......@@ -387,7 +387,7 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
p_sys->p_input = p_sys->p_playlist->p_input;
if( p_sys->p_input )
{
vlc_object_yield( p_sys->p_input );
vlc_object_hold( p_sys->p_input );
var_Get( p_sys->p_input, "position", &val);
sprintf( position, "%d" , (int)((val.f_float) * 100.0));
var_Get( p_sys->p_input, "time", &val);
......
......@@ -1084,7 +1084,7 @@
if( self != nil )
{
psz_name = strdup( name );
_vlc_object = vlc_object_yield( object );
_vlc_object = vlc_object_hold( object );
value = val;
i_type = type;
}
......@@ -1111,7 +1111,7 @@
- (vlc_object_t *)vlcObject
{
return vlc_object_yield( _vlc_object );
return vlc_object_hold( _vlc_object );
}
......
......@@ -271,7 +271,7 @@ static VLCTreeItem *o_root_item = nil;
o_name = [o_item_name copy];
o_title= [o_item_title copy];
o_help= [o_item_help copy];
_vlc_object = object ? vlc_object_yield( object ) : NULL;
_vlc_object = object ? vlc_object_hold( object ) : NULL;
o_parent = o_parent_item;
o_children = o_children_array;
i_object_category = i_category;
......@@ -482,7 +482,7 @@ static VLCTreeItem *o_root_item = nil;
- (vlc_object_t *)vlcObject
{
return vlc_object_yield(_vlc_object);
return vlc_object_hold(_vlc_object);
}
- (NSString *)name
......
......@@ -417,7 +417,7 @@ static void Run( intf_thread_t *p_intf )
{
if( !p_sys->p_input->b_dead )
{
vlc_object_yield( p_sys->p_input );
vlc_object_hold( p_sys->p_input );
}
}
}
......
......@@ -153,7 +153,7 @@ void MediaInfoDialog::update( input_thread_t *p_input )
}
/* Launch the update in all the panels */
vlc_object_yield( p_input );
vlc_object_hold( p_input );
update( input_GetItem(p_input), true, true);
......@@ -171,7 +171,7 @@ void MediaInfoDialog::updateOnTimeOut()
if( p_input && !p_input->b_dead )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
update( input_GetItem(p_input), false, false);
vlc_object_release( p_input );
}
......
......@@ -87,7 +87,7 @@ void InputManager::setInput( input_thread_t *_p_input )
p_input = _p_input;
if( p_input && !( p_input->b_dead || !vlc_object_alive (p_input) ) )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
emit statusChanged( PLAYING_S );
UpdateMeta();
UpdateArt();
......@@ -650,7 +650,7 @@ void MainInputManager::customEvent( QEvent *event )
p_input = THEPL->p_input;
if( p_input && !( !vlc_object_alive (p_input) || p_input->b_dead) )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
var_AddCallback( p_input, "state", PLItemChanged, this );
emit inputChanged( p_input );
}
......
......@@ -464,7 +464,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
p_input = THEMIM->getInput();
if( p_input )
vlc_object_yield( p_input );
vlc_object_hold( p_input );
p_aout = ( vlc_object_t * ) vlc_object_find( p_intf,
VLC_OBJECT_AOUT,
FIND_ANYWHERE );
......@@ -519,7 +519,7 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
p_input = THEMIM->getInput();
if( p_input )
vlc_object_yield( p_input );
vlc_object_hold( p_input );
p_vout = ( vlc_object_t * )vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
......@@ -713,7 +713,7 @@ void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
POPUP_BOILERPLATE;
if( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
vlc_object_t *p_vout = ( vlc_object_t * )vlc_object_find( p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout )
......@@ -733,7 +733,7 @@ void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
POPUP_BOILERPLATE;
if( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
vlc_object_t *p_aout = ( vlc_object_t * )vlc_object_find( p_input,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
AudioAutoMenuBuilder( p_aout, p_input, objects, varnames );
......@@ -753,7 +753,7 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
if( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
varnames.push_back( "audio-es" );
InputAutoMenuBuilder( VLC_OBJECT( p_input ), objects, varnames );
PUSH_SEPARATOR;
......@@ -814,7 +814,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
menu->addSeparator();
vlc_object_yield( p_input );
vlc_object_hold( p_input );
InputAutoMenuBuilder( VLC_OBJECT( p_input ), objects, varnames );
vlc_object_release( p_input );
......
......@@ -330,7 +330,7 @@ void VlcProc::refreshInput()
{
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 );
vlc_object_hold( getIntf()->p_sys->p_input );
}
else if( getIntf()->p_sys->p_input->b_dead )
{
......
......@@ -129,7 +129,7 @@ void FileInfo::Update()
}
pl_Release( p_intf );
vlc_object_yield( p_input );
vlc_object_hold( p_input );
vlc_mutex_lock( &input_GetItem(p_input)->lock );
if( b_need_update == true )
{
......
......@@ -143,7 +143,7 @@ void VLMBroadcastStreamPanel::OnPlay( wxCommandEvent &event )
p_stream->p_media->instance[0]->p_input )
{
vlc_value_t val;
vlc_object_yield( p_stream->p_media->instance[0]->p_input );
vlc_object_hold( p_stream->p_media->instance[0]->p_input );
var_Get( p_stream->p_media->instance[0]->p_input, "state", &val );
if( val.i_int != PAUSE_S )
{
......
......@@ -200,7 +200,7 @@ void InputManager::UpdateInput()
LockPlaylist( p_intf->p_sys, p_playlist );
p_input = 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_hold( p_intf->p_sys->p_input );
UnlockPlaylist( p_intf->p_sys, p_playlist );
pl_Release( p_intf );
}
......
......@@ -282,7 +282,7 @@ void VideoPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
POPUP_BOILERPLATE;
if( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
as_varnames.Add( "video-es" );
ai_objects.Add( p_input->i_object_id );
as_varnames.Add( "spu-es" );
......@@ -306,7 +306,7 @@ void AudioPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
POPUP_BOILERPLATE;
if( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
as_varnames.Add( "audio-es" );
ai_objects.Add( p_input->i_object_id );
vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
......@@ -330,7 +330,7 @@ void MiscPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
POPUP_BOILERPLATE;
if( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
as_varnames.Add( "audio-es" );
InputAutoMenuBuilder( VLC_OBJECT(p_input), ai_objects, as_varnames );
PUSH_SEPARATOR;
......@@ -357,7 +357,7 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
POPUP_BOILERPLATE;
if( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
InputAutoMenuBuilder( VLC_OBJECT(p_input), ai_objects, as_varnames );
/* Video menu */
......
......@@ -215,7 +215,7 @@ static void Close( vlc_object_t *p_this )
p_input = p_playlist->p_input;
if ( p_input )
{
vlc_object_yield( p_input );
vlc_object_hold( p_input );
if( p_sys->b_state_cb )
var_DelCallback( p_input, "state", PlayingChange, p_intf );
......@@ -516,7 +516,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
return VLC_SUCCESS;
}
vlc_object_yield( p_input );
vlc_object_hold( p_input );
PL_UNLOCK;
pl_Release( p_intf );
......@@ -930,7 +930,7 @@ static int ReadMetaData( intf_thread_t *p_this )
return( VLC_SUCCESS );
}
vlc_object_yield( p_input );
vlc_object_hold( p_input );
PL_UNLOCK;
pl_Release( p_this );
......
......@@ -51,7 +51,7 @@ input_thread_t * vlclua_get_input_internal( lua_State *L )
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
PL_LOCK;
input_thread_t *p_input = p_playlist->p_input;
if( p_input ) vlc_object_yield( p_input );
if( p_input ) vlc_object_hold( p_input );
PL_UNLOCK;
vlclua_release_playlist_internal( p_playlist );
return p_input;
......
......@@ -165,7 +165,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
pl_Release( p_this );
if( !p_input ) return VLC_SUCCESS;
vlc_object_yield( p_input );
vlc_object_hold( p_input );
char *psz_name = input_item_GetName( input_GetItem( p_input ) );
if( p_input->b_dead || !psz_name )
......
......@@ -127,7 +127,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
pl_Release( p_this );
if( !p_input ) return VLC_SUCCESS;
vlc_object_yield( p_input );
vlc_object_hold( p_input );
char *psz_name = input_item_GetName( input_GetItem( p_input ) );
if( p_input->b_dead || !psz_name )
......
Supports Markdown
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