]> git.sesse.net Git - vlc/commitdiff
Fixed playlist_IsEmpty usage.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 4 Jan 2009 17:19:16 +0000 (18:19 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 5 Jan 2009 19:49:17 +0000 (20:49 +0100)
The playlist has to be locked before calling it.
Another way could be to change playlist_IsEmpty prototype to have a b_locked
parameter (like others playlist functions).

modules/gui/skins2/commands/cmd_input.cpp

index 0aafe14db548a8a2636628c611f482b128afd110..76a8eab5d8cab8a2bc760e24bfd864dfa14deb4a 100644 (file)
@@ -36,8 +36,14 @@ void CmdPlay::execute()
         return;
     }
 
-    if( !playlist_IsEmpty( pPlaylist ) )
+    vlc_object_lock( pPlaylist );
+    const bool b_empty = playlist_IsEmpty( pPlaylist );
+    vlc_object_unlock( pPlaylist );
+
+    if( !b_empty )
+    {
         playlist_Play( pPlaylist );
+    }
     else
     {
         // If the playlist is empty, open a file requester instead