Commit ed344453 authored by Rémi Duraffort's avatar Rémi Duraffort

Use pl_Yield and pl_Release instead of vlc_object_find.

parent 4a6b8ccc
...@@ -203,8 +203,7 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame, ...@@ -203,8 +203,7 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame,
fLastUpdateTime( system_time() ), fLastUpdateTime( system_time() ),
fSettings( new BMessage( 'sett' ) ) fSettings( new BMessage( 'sett' ) )
{ {
p_playlist = (playlist_t *) p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this ); var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, this ); var_AddCallback( p_playlist, "item-change", PlaylistChanged, this );
...@@ -355,7 +354,7 @@ InterfaceWindow::~InterfaceWindow() ...@@ -355,7 +354,7 @@ InterfaceWindow::~InterfaceWindow()
} }
if( p_playlist ) if( p_playlist )
{ {
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
#if 0 #if 0
if( fPlaylistWindow ) if( fPlaylistWindow )
......
...@@ -690,13 +690,11 @@ PlaylistView::MouseDown( BPoint where ) ...@@ -690,13 +690,11 @@ PlaylistView::MouseDown( BPoint where )
// only do something if user clicked the same item twice // only do something if user clicked the same item twice
if ( fLastClickedItem == item ) if ( fLastClickedItem == item )
{ {
playlist_t * p_playlist; playlist_t * p_playlist = pl_Yield( p_intf );
p_playlist = (playlist_t *) vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist ) if( p_playlist )
{ {
playlist_Goto( p_playlist, i ); playlist_Goto( p_playlist, i );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
handled = true; handled = true;
} }
...@@ -1079,9 +1077,7 @@ PlaylistView::SetDisplayMode( uint32 mode ) ...@@ -1079,9 +1077,7 @@ PlaylistView::SetDisplayMode( uint32 mode )
BListItem* BListItem*
PlaylistView::_PlayingItem() const PlaylistView::_PlayingItem() const
{ {
playlist_t * p_playlist; playlist_t * p_playlist = pl_Yield( p_intf );
p_playlist = (playlist_t *) vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_playlist ) if( !p_playlist )
{ {
...@@ -1089,7 +1085,7 @@ PlaylistView::_PlayingItem() const ...@@ -1089,7 +1085,7 @@ PlaylistView::_PlayingItem() const
} }
BListItem * item = ItemAt( p_playlist->i_index ); BListItem * item = ItemAt( p_playlist->i_index );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
return item; return item;
} }
...@@ -1103,9 +1099,7 @@ PlaylistView::_SetPlayingIndex( BListItem* playingItem ) ...@@ -1103,9 +1099,7 @@ PlaylistView::_SetPlayingIndex( BListItem* playingItem )
{ {
if ( item == playingItem ) if ( item == playingItem )
{ {
playlist_t * p_playlist; playlist_t * p_playlist = pl_Yield( p_intf );
p_playlist = (playlist_t *) vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_playlist ) if( !p_playlist )
{ {
...@@ -1115,7 +1109,7 @@ PlaylistView::_SetPlayingIndex( BListItem* playingItem ) ...@@ -1115,7 +1109,7 @@ PlaylistView::_SetPlayingIndex( BListItem* playingItem )
playlist_Goto( p_playlist, i ); playlist_Goto( p_playlist, i );
SetCurrent( i ); SetCurrent( i );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
break; break;
} }
} }
......
...@@ -291,11 +291,10 @@ PlayListWindow::UpdatePlaylist( bool rebuild ) ...@@ -291,11 +291,10 @@ PlayListWindow::UpdatePlaylist( bool rebuild )
if( rebuild ) if( rebuild )
fListView->RebuildList(); fListView->RebuildList();
p_playlist = (playlist_t *) p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
fListView->SetCurrent( p_playlist->i_index ); fListView->SetCurrent( p_playlist->i_index );
fListView->SetPlaying( p_playlist->status.i_status == PLAYLIST_RUNNING ); fListView->SetPlaying( p_playlist->status.i_status == PLAYLIST_RUNNING );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
_CheckItemsEnableState(); _CheckItemsEnableState();
} }
......
...@@ -288,7 +288,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -288,7 +288,7 @@ static void Run( intf_thread_t *p_intf )
gtk_tree_view_column_set_sort_column_id(p_column, 2); gtk_tree_view_column_set_sort_column_id(p_column, 2);
#endif #endif
/* update the playlist */ /* update the playlist */
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); p_playlist = pl_Yield( p_intf );
p_playlist_store = gtk_list_store_new (3, p_playlist_store = gtk_list_store_new (3,
G_TYPE_STRING, /* Filename */ G_TYPE_STRING, /* Filename */
G_TYPE_STRING, /* Time */ G_TYPE_STRING, /* Time */
...@@ -296,7 +296,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -296,7 +296,7 @@ static void Run( intf_thread_t *p_intf )
PlaylistRebuildListStore(p_intf,p_playlist_store, p_playlist); PlaylistRebuildListStore(p_intf,p_playlist_store, p_playlist);
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(p_playlist_store)); gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(p_playlist_store));
g_object_unref(p_playlist_store); g_object_unref(p_playlist_store);
vlc_object_release(p_playlist); /* Free the playlist */ pl_Release(p_playlist); /* Free the playlist */
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE); gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE);
/* Column properties */ /* Column properties */
...@@ -426,8 +426,7 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -426,8 +426,7 @@ static int Manage( intf_thread_t *p_intf )
p_intf->p_sys->b_playing = 1; p_intf->p_sys->b_playing = 1;
/* update playlist interface */ /* update playlist interface */
p_playlist = (playlist_t *) vlc_object_find( p_playlist = pl_Yield( p_intf );
p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if (p_playlist != NULL) if (p_playlist != NULL)
{ {
p_liststore = gtk_list_store_new (3, p_liststore = gtk_list_store_new (3,
...@@ -437,7 +436,7 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -437,7 +436,7 @@ static int Manage( intf_thread_t *p_intf )
PlaylistRebuildListStore(p_intf, p_liststore, p_playlist); PlaylistRebuildListStore(p_intf, p_liststore, p_playlist);
gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore); gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
g_object_unref(p_liststore); g_object_unref(p_liststore);
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
/* Manage the slider */ /* Manage the slider */
......
...@@ -94,8 +94,7 @@ static void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options, ...@@ -94,8 +94,7 @@ static void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options,
int i_id , i_pos=0; int i_id , i_pos=0;
GtkTreeView *p_tvplaylist = NULL; GtkTreeView *p_tvplaylist = NULL;
p_playlist = (playlist_t *) p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL) if( p_playlist == NULL)
{ /* Bail out when VLC's playlist object is not found. */ { /* Bail out when VLC's playlist object is not found. */
...@@ -147,7 +146,7 @@ static void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options, ...@@ -147,7 +146,7 @@ static void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options,
free(ppsz_options); free(ppsz_options);
} }
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void PlaylistRebuildListStore( intf_thread_t *p_intf, void PlaylistRebuildListStore( intf_thread_t *p_intf,
...@@ -379,7 +378,7 @@ void onPause(GtkButton *button, gpointer user_data) ...@@ -379,7 +378,7 @@ void onPause(GtkButton *button, gpointer user_data)
void onPlay(GtkButton *button, gpointer user_data) void onPlay(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) ); intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) );
playlist_t *p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); playlist_t *p_playlist = pl_Yield( p_intf );
if (p_playlist) if (p_playlist)
{ {
...@@ -394,19 +393,18 @@ void onPlay(GtkButton *button, gpointer user_data) ...@@ -394,19 +393,18 @@ void onPlay(GtkButton *button, gpointer user_data)
{ {
vlc_object_unlock( p_playlist ); vlc_object_unlock( p_playlist );
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
} }
void onStop(GtkButton *button, gpointer user_data) void onStop(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) ); intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) );
playlist_t *p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t *p_playlist = pl_Yield( p_intf );
FIND_ANYWHERE );
if (p_playlist) if (p_playlist)
{ {
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
gdk_window_raise( p_intf->p_sys->p_window->window ); gdk_window_raise( p_intf->p_sys->p_window->window );
} }
} }
...@@ -773,8 +771,7 @@ void onPlaylistRow(GtkTreeView *treeview, GtkTreePath *path, ...@@ -773,8 +771,7 @@ void onPlaylistRow(GtkTreeView *treeview, GtkTreePath *path,
{ {
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(treeview) ); intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(treeview) );
GtkTreeSelection *p_selection = gtk_tree_view_get_selection(treeview); GtkTreeSelection *p_selection = gtk_tree_view_get_selection(treeview);
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = pl_Yield( p_intf );
FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
...@@ -805,15 +802,14 @@ void onPlaylistRow(GtkTreeView *treeview, GtkTreePath *path, ...@@ -805,15 +802,14 @@ void onPlaylistRow(GtkTreeView *treeview, GtkTreePath *path,
i_skip = i_row - p_playlist->i_current_index; i_skip = i_row - p_playlist->i_current_index;
playlist_Skip( p_playlist, i_skip ); playlist_Skip( p_playlist, i_skip );
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void onUpdatePlaylist(GtkButton *button, gpointer user_data) void onUpdatePlaylist(GtkButton *button, gpointer user_data)
{ {
intf_thread_t * p_intf = GtkGetIntf( button ); intf_thread_t * p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = pl_Yield( p_intf );
FIND_ANYWHERE );
GtkTreeView *p_tvplaylist = NULL; GtkTreeView *p_tvplaylist = NULL;
if( p_playlist == NULL ) if( p_playlist == NULL )
...@@ -838,7 +834,7 @@ void onUpdatePlaylist(GtkButton *button, gpointer user_data) ...@@ -838,7 +834,7 @@ void onUpdatePlaylist(GtkButton *button, gpointer user_data)
g_object_unref(p_model); g_object_unref(p_model);
} }
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
static void deleteItemFromPlaylist(gpointer data, gpointer user_data) static void deleteItemFromPlaylist(gpointer data, gpointer user_data)
...@@ -849,8 +845,7 @@ static void deleteItemFromPlaylist(gpointer data, gpointer user_data) ...@@ -849,8 +845,7 @@ static void deleteItemFromPlaylist(gpointer data, gpointer user_data)
void onDeletePlaylist(GtkButton *button, gpointer user_data) void onDeletePlaylist(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = pl_Yield( p_intf );
FIND_ANYWHERE );
GtkTreeView *p_tvplaylist; GtkTreeView *p_tvplaylist;
/* Delete an arbitrary item from the playlist */ /* Delete an arbitrary item from the playlist */
...@@ -912,15 +907,14 @@ void onDeletePlaylist(GtkButton *button, gpointer user_data) ...@@ -912,15 +907,14 @@ void onDeletePlaylist(GtkButton *button, gpointer user_data)
g_object_unref(p_store); g_object_unref(p_store);
} }
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void onClearPlaylist(GtkButton *button, gpointer user_data) void onClearPlaylist(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = pl_Yield( p_intf );
FIND_ANYWHERE );
GtkTreeView *p_tvplaylist; GtkTreeView *p_tvplaylist;
int item; int item;
...@@ -933,7 +927,7 @@ void onClearPlaylist(GtkButton *button, gpointer user_data) ...@@ -933,7 +927,7 @@ void onClearPlaylist(GtkButton *button, gpointer user_data)
{ {
msg_Err( p_playlist, "fix pda delete" ); msg_Err( p_playlist, "fix pda delete" );
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
// Remove all entries from the Playlist widget. // Remove all entries from the Playlist widget.
p_tvplaylist = (GtkTreeView*) lookup_widget( GTK_WIDGET(button), "tvPlaylist"); p_tvplaylist = (GtkTreeView*) lookup_widget( GTK_WIDGET(button), "tvPlaylist");
...@@ -1045,7 +1039,7 @@ void onAddTranscodeToPlaylist(GtkButton *button, gpointer user_data) ...@@ -1045,7 +1039,7 @@ void onAddTranscodeToPlaylist(GtkButton *button, gpointer user_data)
} }
/* Update the playlist */ /* Update the playlist */
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
/* Get all the options. */ /* Get all the options. */
......
...@@ -332,8 +332,7 @@ void DialogsProvider::OnOpenFileSimple( int i_arg ) ...@@ -332,8 +332,7 @@ void DialogsProvider::OnOpenFileSimple( int i_arg )
TCHAR szFile[MAX_PATH] = _T("\0"); TCHAR szFile[MAX_PATH] = _T("\0");
static TCHAR szFilter[] = _T("All (*.*)\0*.*\0"); static TCHAR szFilter[] = _T("All (*.*)\0*.*\0");
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
memset( &ofn, 0, sizeof(OPENFILENAME) ); memset( &ofn, 0, sizeof(OPENFILENAME) );
...@@ -367,7 +366,7 @@ void DialogsProvider::OnOpenFileSimple( int i_arg ) ...@@ -367,7 +366,7 @@ void DialogsProvider::OnOpenFileSimple( int i_arg )
PLAYLIST_APPEND | (i_arg?PLAYLIST_GO:0), PLAYLIST_END ); PLAYLIST_APPEND | (i_arg?PLAYLIST_GO:0), PLAYLIST_END );
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void DialogsProvider::OnOpenDirectory( int i_arg ) void DialogsProvider::OnOpenDirectory( int i_arg )
...@@ -406,8 +405,7 @@ void DialogsProvider::OnOpenDirectory( int i_arg ) ...@@ -406,8 +405,7 @@ void DialogsProvider::OnOpenDirectory( int i_arg )
if( !SUCCEEDED( SHGetMalloc(&p_malloc) ) ) goto error; if( !SUCCEEDED( SHGetMalloc(&p_malloc) ) ) goto error;
p_playlist = (playlist_t *) p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_playlist ) goto error; if( !p_playlist ) goto error;
memset( &bi, 0, sizeof(BROWSEINFO) ); memset( &bi, 0, sizeof(BROWSEINFO) );
...@@ -433,7 +431,7 @@ void DialogsProvider::OnOpenDirectory( int i_arg ) ...@@ -433,7 +431,7 @@ void DialogsProvider::OnOpenDirectory( int i_arg )
error: error:
if( p_malloc) p_malloc->Release(); if( p_malloc) p_malloc->Release();
if( p_playlist ) vlc_object_release( p_playlist ); if( p_playlist ) pl_Release( p_playlist );
#ifdef UNDER_CE #ifdef UNDER_CE
FreeLibrary( ceshell_dll ); FreeLibrary( ceshell_dll );
......
...@@ -637,8 +637,7 @@ void Interface::OnShowDialog( int i_dialog_event ) ...@@ -637,8 +637,7 @@ void Interface::OnShowDialog( int i_dialog_event )
void Interface::OnPlayStream( void ) void Interface::OnPlayStream( void )
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
if( p_playlist->i_size ) if( p_playlist->i_size )
...@@ -653,7 +652,7 @@ void Interface::OnPlayStream( void ) ...@@ -653,7 +652,7 @@ void Interface::OnPlayStream( void )
/* No stream was playing, start one */ /* No stream was playing, start one */
playlist_Play( p_playlist ); playlist_Play( p_playlist );
TogglePlayButton( PLAYING_S ); TogglePlayButton( PLAYING_S );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
return; return;
} }
...@@ -673,14 +672,13 @@ void Interface::OnPlayStream( void ) ...@@ -673,14 +672,13 @@ void Interface::OnPlayStream( void )
TogglePlayButton( state.i_int ); TogglePlayButton( state.i_int );
vlc_object_release( p_input ); vlc_object_release( p_input );
vlc_object_release( p_playlist );
} }
else else
{ {
/* If the playlist is empty, open a file requester instead */ /* If the playlist is empty, open a file requester instead */
vlc_object_release( p_playlist );
OnShowDialog( ID_FILE_QUICKOPEN ); OnShowDialog( ID_FILE_QUICKOPEN );
} }
pl_Release( p_playlist );
} }
void Interface::TogglePlayButton( int i_playing_status ) void Interface::TogglePlayButton( int i_playing_status )
...@@ -812,33 +810,30 @@ void Interface::VolumeUpdate() ...@@ -812,33 +810,30 @@ void Interface::VolumeUpdate()
void Interface::OnStopStream( void ) void Interface::OnStopStream( void )
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
TogglePlayButton( PAUSE_S ); TogglePlayButton( PAUSE_S );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void Interface::OnPrevStream( void ) void Interface::OnPrevStream( void )
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
playlist_Prev( p_playlist ); playlist_Prev( p_playlist );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void Interface::OnNextStream( void ) void Interface::OnNextStream( void )
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
playlist_Next( p_playlist ); playlist_Next( p_playlist );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void Interface::OnSlowStream( void ) void Interface::OnSlowStream( void )
......
...@@ -269,12 +269,11 @@ void ItemInfoDialog::OnOk() ...@@ -269,12 +269,11 @@ void ItemInfoDialog::OnOk()
vlc_mutex_lock( &p_item->input.lock ); vlc_mutex_lock( &p_item->input.lock );
bool b_old_enabled = p_item->b_enabled; bool b_old_enabled = p_item->b_enabled;
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
b_state = SendMessage( enabled_checkbox, BM_GETCHECK, 0, 0 ); b_state = SendMessage( enabled_checkbox, BM_GETCHECK, 0, 0 );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
p_item->b_enabled = (b_state & BST_CHECKED) ? true : false ; p_item->b_enabled = (b_state & BST_CHECKED) ? true : false ;
......
...@@ -221,15 +221,13 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point ) ...@@ -221,15 +221,13 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
} }
else else
{ {
playlist_t * p_playlist = playlist_t * p_playlist = pl_Yield( p_intf );
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist && p_playlist->i_size ) if( p_playlist && p_playlist->i_size )
{ {
AppendMenu( hmenu, MF_SEPARATOR, 0, _T("") ); AppendMenu( hmenu, MF_SEPARATOR, 0, _T("") );
AppendMenu( hmenu, MF_STRING, PlayStream_Event, _T("Play") ); AppendMenu( hmenu, MF_STRING, PlayStream_Event, _T("Play") );
} }
if( p_playlist ) vlc_object_release( p_playlist ); if( p_playlist ) pl_Release( p_playlist );
} }
AppendMenu( hmenu, MF_POPUP|MF_STRING, (UINT)MiscMenu( p_intf ), AppendMenu( hmenu, MF_POPUP|MF_STRING, (UINT)MiscMenu( p_intf ),
......
...@@ -609,9 +609,7 @@ void OpenDialog::OnOk() ...@@ -609,9 +609,7 @@ void OpenDialog::OnOk()
ComboBox_SetCurSel( mrl_combo, ComboBox_GetCount( mrl_combo ) - 1 ); ComboBox_SetCurSel( mrl_combo, ComboBox_GetCount( mrl_combo ) - 1 );
/* Update the playlist */ /* Update the playlist */
playlist_t *p_playlist = playlist_t *p_playlist = pl_Yield( p_intf );
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
for( int i = 0; i < i_args; i++ ) for( int i = 0; i < i_args; i++ )
...@@ -657,7 +655,7 @@ void OpenDialog::OnOk() ...@@ -657,7 +655,7 @@ void OpenDialog::OnOk()
free( pp_args[i_args] ); free( pp_args[i_args] );
if( !i_args ) free( pp_args ); if( !i_args ) free( pp_args );
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -288,8 +288,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -288,8 +288,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
// random, loop, repeat buttons states // random, loop, repeat buttons states
vlc_value_t val; vlc_value_t val;
p_playlist = (playlist_t *) p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_playlist ) break; if( !p_playlist ) break;
var_Get( p_playlist , "random", &val ); var_Get( p_playlist , "random", &val );
...@@ -304,7 +303,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -304,7 +303,7 @@ LRESULT Playlist::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
bState = val.b_bool ? TBSTATE_CHECKED : 0; bState = val.b_bool ? TBSTATE_CHECKED : 0;
SendMessage( hwndTB, TB_SETSTATE, Repeat_Event, SendMessage( hwndTB, TB_SETSTATE, Repeat_Event,
MAKELONG(bState | TBSTATE_ENABLED, 0) ); MAKELONG(bState | TBSTATE_ENABLED, 0) );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
hListView = CreateWindow( WC_LISTVIEW, NULL, WS_VISIBLE | WS_CHILD | hListView = CreateWindow( WC_LISTVIEW, NULL, WS_VISIBLE | WS_CHILD |
...@@ -517,13 +516,12 @@ LRESULT Playlist::ProcessCustomDraw( LPARAM lParam ) ...@@ -517,13 +516,12 @@ LRESULT Playlist::ProcessCustomDraw( LPARAM lParam )
return CDRF_NOTIFYITEMDRAW; return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT: //Before an item is drawn case CDDS_ITEMPREPAINT: //Before an item is drawn
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return CDRF_DODEFAULT; if( p_playlist == NULL ) return CDRF_DODEFAULT;
if( (int)lplvcd->nmcd.dwItemSpec == p_playlist->i_index ) if( (int)lplvcd->nmcd.dwItemSpec == p_playlist->i_index )
{ {
lplvcd->clrText = RGB(255,0,0); lplvcd->clrText = RGB(255,0,0);
vlc_object_release(p_playlist); pl_Release( p_playlist );
return CDRF_NEWFONT; return CDRF_NEWFONT;
} }
...@@ -531,15 +529,16 @@ LRESULT Playlist::ProcessCustomDraw( LPARAM lParam ) ...@@ -531,15 +529,16 @@ LRESULT Playlist::ProcessCustomDraw( LPARAM lParam )
(int)lplvcd->nmcd.dwItemSpec ); (int)lplvcd->nmcd.dwItemSpec );
if( !p_item ) if( !p_item )
{ {
vlc_object_release(p_playlist); pl_Release( p_playlist );
return CDRF_DODEFAULT; return CDRF_DODEFAULT;
} }
if( p_item->b_enabled == false ) if( p_item->b_enabled == false )
{ {
lplvcd->clrText = RGB(192,192,192); lplvcd->clrText = RGB(192,192,192);
vlc_object_release(p_playlist); pl_Release( p_playlist );
return CDRF_NEWFONT; return CDRF_NEWFONT;
} }
pl_Release( p_playlist );
} }
return CDRF_DODEFAULT; return CDRF_DODEFAULT;
...@@ -589,8 +588,7 @@ void Playlist::UpdatePlaylist() ...@@ -589,8 +588,7 @@ void Playlist::UpdatePlaylist()
b_need_update = false; b_need_update = false;
} }
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
/* Update the colour of items */ /* Update the colour of items */
...@@ -606,7 +604,7 @@ void Playlist::UpdatePlaylist() ...@@ -606,7 +604,7 @@ void Playlist::UpdatePlaylist()
} }
vlc_object_unlock( p_playlist ); vlc_object_unlock( p_playlist );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
/********************************************************************** /**********************************************************************
...@@ -614,8 +612,7 @@ void Playlist::UpdatePlaylist() ...@@ -614,8 +612,7 @@ void Playlist::UpdatePlaylist()
**********************************************************************/ **********************************************************************/
void Playlist::Rebuild() void Playlist::Rebuild()
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
int i_focused = int i_focused =
...@@ -648,7 +645,7 @@ void Playlist::Rebuild() ...@@ -648,7 +645,7 @@ void Playlist::Rebuild()
ListView_SetItemState( hListView, i_focused, LVIS_FOCUSED, ListView_SetItemState( hListView, i_focused, LVIS_FOCUSED,
LVIS_STATEIMAGEMASK ); LVIS_STATEIMAGEMASK );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
/********************************************************************** /**********************************************************************
...@@ -656,8 +653,7 @@ void Playlist::Rebuild() ...@@ -656,8 +653,7 @@ void Playlist::Rebuild()
**********************************************************************/ **********************************************************************/
void Playlist::UpdateItem( int i ) void Playlist::UpdateItem( int i )
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
...@@ -665,7 +661,7 @@ void Playlist::UpdateItem( int i ) ...@@ -665,7 +661,7 @@ void Playlist::UpdateItem( int i )
if( !p_item ) if( !p_item )
{ {
vlc_object_release(p_playlist); pl_Release(p_playlist);
return; return;
} }
...@@ -681,7 +677,7 @@ void Playlist::UpdateItem( int i ) ...@@ -681,7 +677,7 @@ void Playlist::UpdateItem( int i )
ListView_SetItemText( hListView, i, 3, _FROMMB(psz_duration) ); ListView_SetItemText( hListView, i, 3, _FROMMB(psz_duration) );
vlc_object_release(p_playlist); pl_Release(p_playlist);
} }
/********************************************************************** /**********************************************************************
...@@ -689,14 +685,13 @@ void Playlist::UpdateItem( int i ) ...@@ -689,14 +685,13 @@ void Playlist::UpdateItem( int i )
**********************************************************************/ **********************************************************************/
void Playlist::DeleteItem( int item ) void Playlist::DeleteItem( int item )
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
playlist_Delete( p_playlist, item ); playlist_Delete( p_playlist, item );
ListView_DeleteItem( hListView, item ); ListView_DeleteItem( hListView, item );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
/********************************************************************** /**********************************************************************
...@@ -708,15 +703,13 @@ static void OnOpenCB( intf_dialog_args_t *p_arg ) ...@@ -708,15 +703,13 @@ static void OnOpenCB( intf_dialog_args_t *p_arg )
if( p_arg->i_results && p_arg->psz_results[0] ) if( p_arg->i_results && p_arg->psz_results[0] )
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist ) if( p_playlist )
{ {
playlist_Import( p_playlist, p_arg->psz_results[0] ); playlist_Import( p_playlist, p_arg->psz_results[0] );
pl_Release( p_playlist );
} }
if( p_playlist ) vlc_object_release( p_playlist );
} }
} }
...@@ -742,8 +735,7 @@ static void OnSaveCB( intf_dialog_args_t *p_arg ) ...@@ -742,8 +735,7 @@ static void OnSaveCB( intf_dialog_args_t *p_arg )
if( p_arg->i_results && p_arg->psz_results[0] ) if( p_arg->i_results && p_arg->psz_results[0] )
{ {
playlist_t * p_playlist = (playlist_t *) playlist_t * p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist ) if( p_playlist )
{ {
...@@ -755,9 +747,8 @@ static void OnSaveCB( intf_dialog_args_t *p_arg ) ...@@ -755,9 +747,8 @@ static void OnSaveCB( intf_dialog_args_t *p_arg )
else psz_export = "export-m3u"; else psz_export = "export-m3u";
playlist_Export( p_playlist, p_arg->psz_results[0], psz_export ); playlist_Export( p_playlist, p_arg->psz_results[0], psz_export );
pl_Release( p_playlist );
} }
if( p_playlist ) vlc_object_release( p_playlist );
} }
} }
...@@ -809,8 +800,7 @@ void Playlist::OnInvertSelection() ...@@ -809,8 +800,7 @@ void Playlist::OnInvertSelection()
void Playlist::OnEnableSelection() void Playlist::OnEnableSelection()
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
for( long item = ListView_GetItemCount( hListView ) - 1; for( long item = ListView_GetItemCount( hListView ) - 1;
...@@ -824,13 +814,12 @@ void Playlist::OnEnableSelection() ...@@ -824,13 +814,12 @@ void Playlist::OnEnableSelection()
UpdateItem( item ); UpdateItem( item );
} }
} }
vlc_object_release( p_playlist); pl_Release( p_playlist);
} }
void Playlist::OnDisableSelection() void Playlist::OnDisableSelection()
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
for( long item = ListView_GetItemCount( hListView ) - 1; for( long item = ListView_GetItemCount( hListView ) - 1;
...@@ -845,7 +834,7 @@ void Playlist::OnDisableSelection() ...@@ -845,7 +834,7 @@ void Playlist::OnDisableSelection()
UpdateItem( item ); UpdateItem( item );
} }
} }
vlc_object_release( p_playlist); pl_Release( p_playlist);
} }
void Playlist::OnSelectAll() void Playlist::OnSelectAll()
...@@ -859,19 +848,17 @@ void Playlist::OnSelectAll() ...@@ -859,19 +848,17 @@ void Playlist::OnSelectAll()
void Playlist::OnActivateItem( int i_item ) void Playlist::OnActivateItem( int i_item )
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
playlist_Goto( p_playlist, i_item ); playlist_Goto( p_playlist, i_item );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void Playlist::ShowInfos( HWND hwnd, int i_item ) void Playlist::ShowInfos( HWND hwnd, int i_item )
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
vlc_object_lock( p_playlist); vlc_object_lock( p_playlist);
...@@ -887,7 +874,7 @@ void Playlist::ShowInfos( HWND hwnd, int i_item ) ...@@ -887,7 +874,7 @@ void Playlist::ShowInfos( HWND hwnd, int i_item )
delete iteminfo_dialog; delete iteminfo_dialog;
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
/******************************************************************** /********************************************************************
...@@ -895,8 +882,7 @@ void Playlist::ShowInfos( HWND hwnd, int i_item ) ...@@ -895,8 +882,7 @@ void Playlist::ShowInfos( HWND hwnd, int i_item )
********************************************************************/ ********************************************************************/
void Playlist::OnUp() void Playlist::OnUp()
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
/* We use the first selected item, so find it */ /* We use the first selected item, so find it */
...@@ -917,15 +903,14 @@ void Playlist::OnUp() ...@@ -917,15 +903,14 @@ void Playlist::OnUp()
LVIS_STATEIMAGEMASK ); LVIS_STATEIMAGEMASK );
} }
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
return; return;
} }
void Playlist::OnDown() void Playlist::OnDown()
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
/* We use the first selected item, so find it */ /* We use the first selected item, so find it */
...@@ -938,7 +923,7 @@ void Playlist::OnDown() ...@@ -938,7 +923,7 @@ void Playlist::OnDown()
ListView_SetItemState( hListView, i_item + 1, LVIS_FOCUSED, ListView_SetItemState( hListView, i_item + 1, LVIS_FOCUSED,
LVIS_STATEIMAGEMASK ); LVIS_STATEIMAGEMASK );
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
return; return;
} }
...@@ -952,12 +937,11 @@ void Playlist::OnRandom() ...@@ -952,12 +937,11 @@ void Playlist::OnRandom()
int bState = SendMessage( hwndTB, TB_GETSTATE, Random_Event, 0 ); int bState = SendMessage( hwndTB, TB_GETSTATE, Random_Event, 0 );
val.b_bool = (bState & TBSTATE_CHECKED) ? true : false; val.b_bool = (bState & TBSTATE_CHECKED) ? true : false;
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
var_Set( p_playlist , "random", val ); var_Set( p_playlist , "random", val );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void Playlist::OnLoop () void Playlist::OnLoop ()
...@@ -966,12 +950,11 @@ void Playlist::OnLoop () ...@@ -966,12 +950,11 @@ void Playlist::OnLoop ()
int bState = SendMessage( hwndTB, TB_GETSTATE, Loop_Event, 0 ); int bState = SendMessage( hwndTB, TB_GETSTATE, Loop_Event, 0 );
val.b_bool = (bState & TBSTATE_CHECKED) ? true : false; val.b_bool = (bState & TBSTATE_CHECKED) ? true : false;
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
var_Set( p_playlist , "loop", val ); var_Set( p_playlist , "loop", val );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void Playlist::OnRepeat () void Playlist::OnRepeat ()
...@@ -980,12 +963,11 @@ void Playlist::OnRepeat () ...@@ -980,12 +963,11 @@ void Playlist::OnRepeat ()
int bState = SendMessage( hwndTB, TB_GETSTATE, Repeat_Event, 0 ); int bState = SendMessage( hwndTB, TB_GETSTATE, Repeat_Event, 0 );
val.b_bool = (bState & TBSTATE_CHECKED) ? true : false; val.b_bool = (bState & TBSTATE_CHECKED) ? true : false;
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
var_Set( p_playlist , "repeat", val ); var_Set( p_playlist , "repeat", val );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
/******************************************************************** /********************************************************************
...@@ -993,8 +975,7 @@ void Playlist::OnRepeat () ...@@ -993,8 +975,7 @@ void Playlist::OnRepeat ()
********************************************************************/ ********************************************************************/
void Playlist::OnSort( UINT event ) void Playlist::OnSort( UINT event )
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
switch( event ) switch( event )
...@@ -1016,7 +997,7 @@ void Playlist::OnSort( UINT event ) ...@@ -1016,7 +997,7 @@ void Playlist::OnSort( UINT event )
break; break;
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
b_need_update = true; b_need_update = true;
...@@ -1025,8 +1006,7 @@ void Playlist::OnSort( UINT event ) ...@@ -1025,8 +1006,7 @@ void Playlist::OnSort( UINT event )
void Playlist::OnColSelect( int iSubItem ) void Playlist::OnColSelect( int iSubItem )
{ {
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
switch( iSubItem ) switch( iSubItem )
...@@ -1059,7 +1039,7 @@ void Playlist::OnColSelect( int iSubItem ) ...@@ -1059,7 +1039,7 @@ void Playlist::OnColSelect( int iSubItem )
break; break;
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
b_need_update = true; b_need_update = true;
...@@ -1074,8 +1054,7 @@ void Playlist::OnPopupPlay() ...@@ -1074,8 +1054,7 @@ void Playlist::OnPopupPlay()
int i_popup_item = int i_popup_item =
ListView_GetNextItem( hListView, -1, LVIS_SELECTED | LVNI_ALL ); ListView_GetNextItem( hListView, -1, LVIS_SELECTED | LVNI_ALL );
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
if( i_popup_item != -1 ) if( i_popup_item != -1 )
...@@ -1083,7 +1062,7 @@ void Playlist::OnPopupPlay() ...@@ -1083,7 +1062,7 @@ void Playlist::OnPopupPlay()
playlist_Goto( p_playlist, i_popup_item ); playlist_Goto( p_playlist, i_popup_item );
} }
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
void Playlist::OnPopupDel() void Playlist::OnPopupDel()
...@@ -1099,8 +1078,7 @@ void Playlist::OnPopupEna() ...@@ -1099,8 +1078,7 @@ void Playlist::OnPopupEna()
int i_popup_item = int i_popup_item =
ListView_GetNextItem( hListView, -1, LVIS_SELECTED | LVNI_ALL ); ListView_GetNextItem( hListView, -1, LVIS_SELECTED | LVNI_ALL );
playlist_t *p_playlist = (playlist_t *) playlist_t *p_playlist = pl_Yield( p_intf );
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return; if( p_playlist == NULL ) return;
playlist_item_t *p_item = playlist_item_t *p_item =
...@@ -1116,7 +1094,7 @@ void Playlist::OnPopupEna() ...@@ -1116,7 +1094,7 @@ void Playlist::OnPopupEna()
playlist_Enable( p_playlist, p_item ); playlist_Enable( p_playlist, p_item );
} }
vlc_object_release( p_playlist); pl_Release( p_playlist);
UpdateItem( i_popup_item ); UpdateItem( i_popup_item );
} }
......
...@@ -52,13 +52,11 @@ Timer::Timer( intf_thread_t *_p_intf, HWND hwnd, Interface *_p_main_interface) ...@@ -52,13 +52,11 @@ Timer::Timer( intf_thread_t *_p_intf, HWND hwnd, Interface *_p_main_interface)
i_old_rate = INPUT_RATE_DEFAULT; i_old_rate = INPUT_RATE_DEFAULT;
/* Register callback for the intf-popupmenu variable */ /* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist = playlist_t *p_playlist = pl_Yield( p_intf );
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf ); var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
SetTimer( hwnd, 1, 200 /*milliseconds*/, NULL ); SetTimer( hwnd, 1, 200 /*milliseconds*/, NULL );
...@@ -67,13 +65,11 @@ Timer::Timer( intf_thread_t *_p_intf, HWND hwnd, Interface *_p_main_interface) ...@@ -67,13 +65,11 @@ Timer::Timer( intf_thread_t *_p_intf, HWND hwnd, Interface *_p_main_interface)
Timer::~Timer() Timer::~Timer()
{ {
/* Unregister callback */ /* Unregister callback */
playlist_t *p_playlist = playlist_t *p_playlist = pl_Yield( p_intf );
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf ); var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
} }
......
...@@ -371,12 +371,11 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -371,12 +371,11 @@ static int Manage( vout_thread_t *p_vout )
break; break;
case CACA_EVENT_QUIT: case CACA_EVENT_QUIT:
{ {
p_playlist = vlc_object_find( p_vout, p_playlist = pl_Yield( p_vout );
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist ) if( p_playlist )
{ {
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
vlc_object_release( p_playlist ); pl_Release( p_vout );
} }
vlc_object_kill( p_vout->p_libvlc ); vlc_object_kill( p_vout->p_libvlc );
break; break;
......
...@@ -2123,17 +2123,15 @@ static int WallpaperCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -2123,17 +2123,15 @@ static int WallpaperCallback( vlc_object_t *p_this, char const *psz_cmd,
if( (newval.b_bool && !p_vout->p_sys->b_wallpaper) || if( (newval.b_bool && !p_vout->p_sys->b_wallpaper) ||
(!newval.b_bool && p_vout->p_sys->b_wallpaper) ) (!newval.b_bool && p_vout->p_sys->b_wallpaper) )
{ {
playlist_t *p_playlist; playlist_t *p_playlist = pl_Yield( p_vout );
p_playlist = vlc_object_find( p_this,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist ) if( p_playlist )
{ {
/* Modify playlist as well because the vout might have to be /* Modify playlist as well because the vout might have to be
* restarted */ * restarted */
var_Create( p_playlist, "directx-wallpaper", VLC_VAR_BOOL ); var_Create( p_playlist, "directx-wallpaper", VLC_VAR_BOOL );
var_Set( p_playlist, "directx-wallpaper", newval ); var_Set( p_playlist, "directx-wallpaper", newval );
vlc_object_release( p_playlist ); pl_Release( p_playlist );
} }
p_vout->p_sys->i_changes |= DX_WALLPAPER_CHANGE; p_vout->p_sys->i_changes |= DX_WALLPAPER_CHANGE;
......
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