[vlc-commits] Qt, playlist: fix a deadlock (#3052)
Jean-Baptiste Kempf
git at videolan.org
Sat Apr 23 02:03:56 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Apr 23 01:53:41 2011 +0200| [4e318891a4cb072d0f72ffc946c72c208922b926] | committer: Jean-Baptiste Kempf
Qt, playlist: fix a deadlock (#3052)
input_Read doesn't seem a good idea when input is a dvd://
Maybe use a playlist_PreparseEnqueue ?
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4e318891a4cb072d0f72ffc946c72c208922b926
---
.../gui/qt4/components/playlist/playlist_model.cpp | 6 +++---
modules/gui/qt4/dialogs_provider.cpp | 4 +---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 03ed94c..2454d5a 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -929,6 +929,8 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
}
menu.addSeparator();
}
+ vlc_gc_decref( p_input );
+
if( canEdit() )
{
QIcon addIcon( ":/buttons/playlist/playlist_add" );
@@ -957,8 +959,7 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
{
sortingMenu = new QMenu( qtr( "Sort by" ) );
sortingMapper = new QSignalMapper( this );
- int i, j;
- for( i = 1, j = 1; i < COLUMN_END; i <<= 1, j++ )
+ for( int i = 1, j = 1; i < COLUMN_END; i <<= 1, j++ )
{
if( i == COLUMN_NUMBER ) continue;
QMenu *m = sortingMenu->addMenu( qfu( psz_column_title( i ) ) );
@@ -973,7 +974,6 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
}
menu.addMenu( sortingMenu );
}
- vlc_gc_decref( p_input );
if( !menu.isEmpty() )
{
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index ed0fa36..1677814 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -515,10 +515,8 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput( THEPL, p_input,
- go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
+ go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
PLAYLIST_END, pl, pl_Unlocked );
- if( !go )
- input_Read( THEPL, p_input );
vlc_gc_decref( p_input );
}
More information about the vlc-commits
mailing list