Commit 7e4d50ac authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove pl_Release, and rename pl_Hold back to pl_Get

pl_Hold() assumed the playlist was already created.
pl_Release() does not solve any problem. Playlist synchronization is
done with the playlist lock, while playlist deletion must anyway be done
after all interfaces, services and other threads are joined.
parent 57f92bde
......@@ -260,11 +260,8 @@ enum pl_locked_state
#define PL_UNLOCK playlist_Unlock( p_playlist )
#define PL_ASSERT_LOCKED playlist_AssertLocked( p_playlist )
VLC_EXPORT( playlist_t *, pl_Hold, ( vlc_object_t * ) );
#define pl_Hold( a ) pl_Hold( VLC_OBJECT(a) )
VLC_EXPORT( void, pl_Release, ( vlc_object_t * ) );
#define pl_Release(a) pl_Release( VLC_OBJECT(a) )
VLC_EXPORT( playlist_t *, pl_Get, ( vlc_object_t * ) );
#define pl_Get( a ) pl_Get( VLC_OBJECT(a) )
/* Playlist control */
#define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, pl_Unlocked )
......@@ -379,11 +376,7 @@ VLC_EXPORT( playlist_item_t *, playlist_GetPrevLeaf, ( playlist_t *p_playlist, p
#define pl_CurrentInput(a) __pl_CurrentInput( VLC_OBJECT(a) )
static inline input_thread_t * __pl_CurrentInput( vlc_object_t * p_this )
{
playlist_t * p_playlist = pl_Hold( p_this );
if( !p_playlist ) return NULL;
input_thread_t * p_input = playlist_CurrentInput( p_playlist );
pl_Release( p_this );
return p_input;
return playlist_CurrentInput( pl_Get( p_this ) );
}
/** Tell if the playlist is empty */
......
......@@ -282,7 +282,7 @@ static int Open( vlc_object_t *p_this )
if( var_InheritInteger(p_this, SOUT_CFG_PREFIX "bonjour") )
{
char *psz_txt, *psz_name;
playlist_t *p_playlist = pl_Hold( p_access );
playlist_t *p_playlist = pl_Get( p_access );
char *psz_uri = input_item_GetURI( p_playlist->status.p_item->p_input );
char *psz_newuri = psz_uri;
......@@ -293,7 +293,6 @@ static int Open( vlc_object_t *p_this )
if( psz_file_name &&
asprintf( &psz_txt, "path=%s", psz_file_name ) == -1 )
{
pl_Release( p_access );
free( psz_uri );
return VLC_ENOMEM;
}
......@@ -307,7 +306,6 @@ static int Open( vlc_object_t *p_this )
if( p_sys->p_bonjour == NULL )
msg_Err( p_access, "unable to start requested Bonjour announce" );
pl_Release( p_access );
}
else
p_sys->p_bonjour = NULL;
......
......@@ -745,7 +745,7 @@ static int Open( vlc_object_t *p_this )
p_sys->p_events = vlc_array_new();
vlc_mutex_init( &p_sys->lock );
p_playlist = pl_Hold( p_intf );
p_playlist = pl_Get( p_intf );
p_sys->p_playlist = p_playlist;
PL_LOCK;
......@@ -788,7 +788,6 @@ static void Close ( vlc_object_t *p_this )
var_DelCallback( p_input, "state", AllCallback, p_intf );
vlc_object_release( p_input );
}
pl_Release( p_intf );
dbus_connection_unref( p_sys->p_conn );
......
......@@ -203,7 +203,7 @@ static void RunIntf( intf_thread_t *p_intf )
/* If you modify this, please try to follow this convention:
Start with LEFT, RIGHT for playback related commands
and UP, DOWN, for other commands */
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
switch( p_sys->i_pattern )
{
case LEFT:
......@@ -399,7 +399,6 @@ static void RunIntf( intf_thread_t *p_intf )
p_sys->i_num_gestures = 0;
p_sys->i_pattern = 0;
p_sys->b_got_gesture = false;
pl_Release( p_intf );
}
/*
......@@ -417,9 +416,7 @@ static void RunIntf( intf_thread_t *p_intf )
if( p_sys->p_vout == NULL )
{
playlist_t *p_playlist = pl_Hold( p_intf );
p_input = playlist_CurrentInput( p_playlist );
pl_Release( p_intf );
p_input = playlist_CurrentInput( pl_Get( p_intf ) );
if( p_input )
{
p_sys->p_vout = input_GetVout( p_input );
......
......@@ -146,7 +146,7 @@ static void Close( vlc_object_t *p_this )
static int PutAction( intf_thread_t *p_intf, int i_action )
{
intf_sys_t *p_sys = p_intf->p_sys;
playlist_t *p_playlist = pl_Hold( p_intf );
playlist_t *p_playlist = pl_Get( p_intf );
/* Update the input */
input_thread_t *p_input = playlist_CurrentInput( p_playlist );
......@@ -887,7 +887,6 @@ cleanup_and_continue:
vlc_object_release( p_vout );
if( p_input )
vlc_object_release( p_input );
pl_Release( p_intf );
return VLC_SUCCESS;
}
......@@ -960,7 +959,7 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
if( asprintf( &psz_bookmark_name, "bookmark%i", i_num ) == -1 )
return;
playlist_t *p_playlist = pl_Hold( p_intf );
playlist_t *p_playlist = pl_Get( p_intf );
char *psz_bookmark = var_CreateGetString( p_intf, psz_bookmark_name );
PL_LOCK;
......@@ -980,7 +979,6 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
free( psz_bookmark );
free( psz_bookmark_name );
pl_Release( p_intf );
}
static void SetBookmark( intf_thread_t *p_intf, int i_num )
......@@ -989,7 +987,7 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
if( asprintf( &psz_bookmark_name, "bookmark%i", i_num ) == -1 )
return;
playlist_t *p_playlist = pl_Hold( p_intf );
playlist_t *p_playlist = pl_Get( p_intf );
var_Create( p_intf, psz_bookmark_name,
VLC_VAR_STRING|VLC_VAR_DOINHERIT );
playlist_item_t * p_item = playlist_CurrentPlayingItem( p_playlist );
......@@ -1002,7 +1000,6 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
config_SaveConfigFile( p_intf, "hotkeys" );
}
pl_Release( p_intf );
free( psz_bookmark_name );
}
......
......@@ -130,7 +130,7 @@ static int Open( vlc_object_t *p_this )
return( VLC_ENOMEM );
}
p_sys->p_playlist = pl_Hold( p_this );
p_sys->p_playlist = pl_Get( p_this );
p_sys->p_input = NULL;
p_sys->p_vlm = NULL;
p_sys->psz_address = psz_address;
......@@ -212,7 +212,6 @@ static int Open( vlc_object_t *p_this )
if( p_sys->p_httpd_host == NULL )
{
msg_Err( p_intf, "cannot listen on %s:%d", psz_address, i_port );
pl_Release( p_this );
free( p_sys->psz_address );
free( p_sys );
return VLC_EGENERIC;
......@@ -285,7 +284,6 @@ failed:
httpd_HostDelete( p_sys->p_httpd_host );
free( p_sys->psz_address );
free( p_sys );
pl_Release( p_this );
return VLC_EGENERIC;
}
......@@ -336,7 +334,6 @@ static void Close ( vlc_object_t *p_this )
httpd_HostDelete( p_sys->p_httpd_host );
free( p_sys->psz_address );
free( p_sys );
pl_Release( p_this );
}
/****************************************************************************
......
......@@ -139,7 +139,7 @@ static int Open(vlc_object_t *object)
sys->timeout = var_InheritInteger(intf, "netsync-timeout");
if (sys->timeout < 500)
sys->timeout = 500;
sys->playlist = pl_Hold(intf);
sys->playlist = pl_Get(intf);
sys->input = NULL;
var_AddCallback(sys->playlist, "input-current", PlaylistEvent, intf);
......@@ -156,7 +156,6 @@ void Close(vlc_object_t *object)
assert(sys->input == NULL);
var_DelCallback(sys->playlist, "input-current", PlaylistEvent, intf);
pl_Release(intf);
net_Close(sys->fd);
free(sys);
}
......
......@@ -439,7 +439,7 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
static void Run( intf_thread_t *p_intf )
{
input_thread_t * p_input = NULL;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
char p_buffer[ MAX_LINE_LENGTH + 1 ];
bool b_showpos = var_InheritInteger( p_intf, "rc-show-pos" );
......@@ -800,8 +800,6 @@ static void Run( intf_thread_t *p_intf )
vlc_object_release( p_input );
}
pl_Release( p_intf );
var_DelCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, p_intf );
vlc_restorecancel( canc );
}
......
......@@ -86,7 +86,7 @@ static int Open( vlc_object_t *p_this )
if( p_intf->p_sys == NULL )
return VLC_ENOMEM;
p_sys->p_playlist = pl_Hold( p_intf );
p_sys->p_playlist = pl_Get( p_intf );
p_sys->p_input = NULL;
p_sys->p_main_window = NULL;
......@@ -100,7 +100,6 @@ static int Open( vlc_object_t *p_this )
vlc_sem_init (&p_sys->ready, 0);
if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )
{
pl_Release (p_sys->p_playlist);
free (p_sys);
return VLC_ENOMEM;
}
......@@ -122,7 +121,6 @@ static void Close( vlc_object_t *p_this )
var_Destroy (p_this->p_libvlc, "hildon-iface");
vlc_join (p_intf->p_sys->thread, NULL);
pl_Release ( p_intf->p_sys->p_playlist );
vlc_spin_destroy( &p_intf->p_sys->event_lock );
free( p_intf->p_sys );
}
......
......@@ -41,7 +41,7 @@
if ( [o_command isEqualToString:@"GetURL"] || [o_command isEqualToString:@"OpenURL"] )
{
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
if( p_playlist == NULL )
{
return nil;
......@@ -69,7 +69,6 @@
noteNewRecentDocumentURL: o_url];
}
}
pl_Release( p_intf );
}
return nil;
}
......@@ -90,7 +89,7 @@
NSString *o_command = [[self commandDescription] commandName];
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
if( p_playlist == NULL )
{
return nil;
......@@ -133,7 +132,6 @@
[o_controls volumeDown:self];
}
}
pl_Release( p_intf );
return nil;
}
......
......@@ -121,15 +121,13 @@
- (IBAction)play:(id)sender
{
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
bool empty;
PL_LOCK;
empty = playlist_IsEmpty( p_playlist );
PL_UNLOCK;
pl_Release( p_intf );
if( empty )
[o_main intfOpenFileGeneric: (id)sender];
......@@ -206,7 +204,7 @@
{
vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
var_Get( p_playlist, "random", &val );
val.b_bool = !val.b_bool;
......@@ -224,7 +222,6 @@
p_intf->p_sys->b_playmode_update = true;
p_intf->p_sys->b_intf_update = true;
pl_Release( p_intf );
}
/* three little ugly helpers */
......@@ -249,21 +246,20 @@
- (void)shuffle
{
vlc_value_t val;
playlist_t *p_playlist = pl_Hold( VLCIntf );
playlist_t *p_playlist = pl_Get( VLCIntf );
var_Get( p_playlist, "random", &val );
[o_btn_shuffle setState: val.b_bool];
if(val.b_bool)
[o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffleOn"]];
else
[o_btn_shuffle_embed setImage: [NSImage imageNamed:@"sidebarShuffle"]];
pl_Release( VLCIntf );
}
- (IBAction)repeatButtonAction:(id)sender
{
vlc_value_t looping,repeating;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
var_Get( p_playlist, "repeat", &repeating );
var_Get( p_playlist, "loop", &looping );
......@@ -322,8 +318,6 @@
var_Set( p_playlist, "loop", looping );
p_intf->p_sys->b_playmode_update = true;
p_intf->p_sys->b_intf_update = true;
pl_Release( p_intf );
}
......@@ -331,7 +325,7 @@
{
vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
var_Get( p_playlist, "repeat", &val );
if (!val.b_bool)
......@@ -353,14 +347,13 @@
p_intf->p_sys->b_playmode_update = true;
p_intf->p_sys->b_intf_update = true;
pl_Release( p_intf );
}
- (IBAction)loop:(id)sender
{
vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
var_Get( p_playlist, "loop", &val );
if (!val.b_bool)
......@@ -382,17 +375,13 @@
p_intf->p_sys->b_playmode_update = true;
p_intf->p_sys->b_intf_update = true;
pl_Release( p_intf );
}
- (IBAction)quitAfterPlayback:(id)sender
{
vlc_value_t val;
playlist_t * p_playlist = pl_Hold( VLCIntf );
var_Get( p_playlist, "play-and-exit", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "play-and-exit", val );
pl_Release( VLCIntf );
playlist_t * p_playlist = pl_Get( VLCIntf );
var_ToggleBool( p_playlist, "play-and-exit" );
}
- (IBAction)forward:(id)sender
......@@ -436,13 +425,12 @@
- (IBAction)volumeSliderUpdated:(id)sender
{
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
audio_volume_t i_volume = (audio_volume_t)[sender intValue];
int i_volume_step;
i_volume_step = config_GetInt( p_intf->p_libvlc, "volume-step" );
aout_VolumeSet( p_playlist, i_volume * i_volume_step );
pl_Release( p_intf );
/* Manage volume status */
[o_main manageVolumeSlider];
}
......@@ -517,15 +505,13 @@
}
else
{
playlist_t * p_playlist = pl_Hold( VLCIntf );
playlist_t * p_playlist = pl_Get( VLCIntf );
if( [o_title isEqualToString: _NS("Fullscreen")] ||
[sender isKindOfClass:[NSButton class]] )
{
var_ToggleBool( p_playlist, "fullscreen" );
}
pl_Release( VLCIntf );
}
vlc_object_release( p_input );
}
......@@ -1018,7 +1004,7 @@
BOOL bEnabled = TRUE;
vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
input_thread_t * p_input = playlist_CurrentInput( p_playlist );
if( [[o_mi title] isEqualToString: _NS("Faster")] ||
......@@ -1154,7 +1140,6 @@
}
if( p_input ) vlc_object_release( p_input );
pl_Release( p_intf );
return( bEnabled );
}
......
......@@ -207,12 +207,11 @@
- (BOOL)windowShouldClose:(id)sender
{
playlist_t * p_playlist = pl_Hold( VLCIntf );
playlist_t * p_playlist = pl_Get( VLCIntf );
/* Only want to stop playback if video is playing */
if( videoRatio.height != 0. && videoRatio.width != 0. )
playlist_Stop( p_playlist );
pl_Release( VLCIntf );
return YES;
}
......
......@@ -53,7 +53,7 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
vlc_object_t *p_object = VLC_OBJECT(p_aout);
if( !p_object )
{
p_object = (vlc_object_t *)pl_Hold( p_intf );
p_object = vlc_object_hold(pl_Get( p_intf ));
}
psz_string = var_GetNonEmptyString( p_object, "audio-filter" );
......@@ -116,7 +116,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
char *psz_parser, *psz_string;
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = (vlc_object_t *)pl_Hold( p_intf );
p_object = vlc_object_hold(pl_Get( p_intf ));
if( (BOOL)config_GetInt( p_intf, "macosx-eq-keep" ) == YES )
psz_string = config_GetPsz( p_intf, "audio-filter" );
......@@ -172,7 +172,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = (vlc_object_t *)pl_Hold( p_intf );
p_object = vlc_object_hold(pl_Get( p_intf ));
var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT |
VLC_VAR_DOINHERIT );
......@@ -227,7 +227,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = (vlc_object_t *)pl_Hold( p_intf );
p_object = vlc_object_hold(pl_Get( p_intf ));
const char *psz_values;
NSString *preset = [NSString stringWithFormat:@"%.1f", [o_slider_band1 floatValue] ];
......@@ -262,7 +262,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
int i;
vlc_object_t *p_object= VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = (vlc_object_t *)pl_Hold( p_intf );
p_object = vlc_object_hold(pl_Get( p_intf ));
var_SetString( p_object , "equalizer-preset" , preset_list[[sender indexOfSelectedItem]] );
......@@ -306,7 +306,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = (vlc_object_t *)pl_Hold( p_intf );
p_object = vlc_object_hold(pl_Get( p_intf ));
var_SetFloat( p_object, "equalizer-preamp", f_preamp );
......@@ -345,7 +345,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
aout_instance_t *p_aout = getAout();
vlc_object_t *p_object= VLC_OBJECT(p_aout);
if( p_object == NULL )
p_object = (vlc_object_t *)pl_Hold( p_intf );
p_object = vl_object_hold(pl_Get( p_intf ));
var_SetBool( p_object, "equalizer-2pass", b_2p );
......@@ -371,7 +371,7 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
int i;
vlc_object_t *p_object= VLC_OBJECT(getAout());
if( p_object == NULL )
p_object = (vlc_object_t *)pl_Hold( VLCIntf );
p_object = vlc_object_hold(pl_Get( VLCIntf ));
[o_window setExcludedFromWindowsMenu: TRUE];
......
......@@ -409,7 +409,7 @@ static VLCExtended *_o_sharedInstance = nil;
id o_window = [NSApp keyWindow];
NSArray *o_windows = [NSApp orderedWindows];
NSEnumerator *o_enumerator = [o_windows objectEnumerator];
playlist_t * p_playlist = pl_Hold( VLCIntf );
playlist_t * p_playlist = pl_Get( VLCIntf );
vout_thread_t *p_vout = getVout();
vout_thread_t *p_real_vout;
......@@ -436,8 +436,6 @@ static VLCExtended *_o_sharedInstance = nil;
/* store to prefs */
config_PutFloat( p_playlist , "macosx-opaqueness" , val.f_float );
pl_Release( VLCIntf );
o_config_changed = YES;
}
......@@ -746,7 +744,7 @@ static VLCExtended *_o_sharedInstance = nil;
{
/* save the preferences to make sure that our module-changes will up on
* next launch again */
playlist_t * p_playlist = pl_Hold( VLCIntf );
playlist_t * p_playlist = pl_Get( VLCIntf );
int returnedValue;
NSArray * theModules;
theModules = [[NSArray alloc] initWithObjects: @"main",
......@@ -775,7 +773,6 @@ static VLCExtended *_o_sharedInstance = nil;
"extended control attribute '%s' (%i)",
[[theModules objectAtIndex: x] UTF8String] , returnedValue);
[theModules release];
pl_Release( VLCIntf );
return;
}
......@@ -786,6 +783,5 @@ static VLCExtended *_o_sharedInstance = nil;
msg_Dbg( VLCIntf, "VLCExtended: saved certain preferences successfully" );
[theModules release];
pl_Release( VLCIntf );
}
@end
......@@ -514,7 +514,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_size_with_playlist = [o_window contentRectForFrameRect:[o_window frame]].size;
p_playlist = pl_Hold( p_intf );
p_playlist = pl_Get( p_intf );
var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
val.b_bool = false;
......@@ -522,8 +522,6 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self);
var_AddCallback( p_intf->p_libvlc, "intf-show", ShowController, self);
pl_Release( p_intf );
/* load our Core Dialogs nib */
nib_coredialogs_loaded = [NSBundle loadNibNamed:@"CoreDialogs" owner: NSApp];
......@@ -898,10 +896,8 @@ static VLCMain *_o_sharedMainInstance = nil;
/* Kill the playlist, so that it doesn't accept new request
* such as the play request from vlc.c (we are a blocking interface). */
p_playlist = pl_Hold( p_intf );
p_playlist = pl_Get( p_intf );
vlc_object_kill( p_playlist );
pl_Release( p_intf );
libvlc_Quit( p_intf->p_libvlc );
[self setIntf:nil];
......@@ -1554,8 +1550,6 @@ static void manage_cleanup( void * args )
var_DelCallback( p_playlist, "playlist-item-append", PlaylistChanged, self );
var_DelCallback( p_playlist, "playlist-item-deleted", PlaylistChanged, self );
pl_Release( p_intf );
if( p_input ) vlc_object_release( p_input );
}
......@@ -1568,7 +1562,7 @@ static void manage_cleanup( void * args )
vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW );
p_playlist = pl_Hold( p_intf );
p_playlist = pl_Get( p_intf );
var_AddCallback( p_playlist, "item-current", PlaylistChanged, self );
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
......@@ -1629,10 +1623,9 @@ static void manage_cleanup( void * args )
- (void)manageVolumeSlider
{
audio_volume_t i_volume;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
aout_VolumeGet( p_playlist, &i_volume );
pl_Release( p_intf );
if( i_volume != i_lastShownVolume )
{
......@@ -1659,13 +1652,12 @@ static void manage_cleanup( void * args )
* the playlist or the selection is empty */
if( [self isPlaylistCollapsed] == YES )
{
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
PL_LOCK;
playlist_item_t * p_item = playlist_CurrentPlayingItem( p_playlist );
PL_UNLOCK;
if( p_item )
[[self info] updatePanelWithItem: p_item->p_input];
pl_Release( p_intf );
}
}
if( p_intf->p_sys->b_intf_update )
......@@ -1676,7 +1668,7 @@ static void manage_cleanup( void * args )
bool b_seekable = false;
bool b_chapters = false;
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
PL_LOCK;
b_plmul = playlist_CurrentSize( p_playlist ) > 1;
......@@ -1706,7 +1698,6 @@ static void manage_cleanup( void * args )
//b_chapters = p_input->stream.i_area_nb > 1;
vlc_object_release( p_input );
}
pl_Release( p_intf );
if( b_buffering )
{
......@@ -1882,7 +1873,7 @@ end:
- (void)setupMenus
{
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
input_thread_t * p_input = playlist_CurrentInput( p_playlist );
if( p_input != NULL )
{
......@@ -1950,7 +1941,6 @@ end:
}
vlc_object_release( p_input );
}
pl_Release( p_intf );
}
- (void)refreshVoutDeviceMenu:(NSNotification *)o_notification
......@@ -1990,7 +1980,7 @@ end:
- (void)resetScrollField
{
playlist_t * p_playlist = pl_Hold( p_intf );
playlist_t * p_playlist = pl_Get( p_intf );
input_thread_t * p_input = playlist_CurrentInput( p_playlist );
i_end_scroll = -1;
......@@ -2007,10 +1997,8 @@ end:
[self setScrollField: o_temp stopAfter:-1];
[[[self controls] fspanel] setStreamTitle: o_temp];
vlc_object_release( p_input );
pl_Release( p_intf );
return;
}
pl_Release( p_intf );
[self setScrollField: _NS("VLC media player") stopAfter:-1];
}
......@@ -2074,7 +2062,7 @@ end:
default:
return;
}
p_playlist = pl_Hold( p_intf );
p_playlist = pl_Get( p_intf );
p_input = playlist_CurrentInput( p_playlist );
if( p_input != NULL )
{
......@@ -2102,7 +2090,6 @@ end:
[o_embedded_window setTime: o_time position: f_updated];
vlc_object_release( p_input );
}
pl_Release( p_intf );
}
- (IBAction)timeFieldWasClicked:(id)sender
......
......@@ -115,7 +115,7 @@
}
- (void)awakeFromNib
{
playlist_t * p_playlist = pl_Hold( VLCIntf );
playlist_t * p_playlist = pl_Get( VLCIntf );
[o_outline_view setTarget: self];
[o_outline_view setDelegate: self];
[o_outline_view setDataSource: self];
......@@ -127,7 +127,6 @@
[o_outline_view_other setDataSource: self];
[o_outline_view_other setAllowsEmptySelection: NO];
pl_Release( VLCIntf );
[self initStrings];
}
...