[vlc-devel] commit: Fixed playlist_IsEmpty usage. (Laurent Aimar )

git version control git at videolan.org
Mon Jan 5 21:26:47 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jan  4 18:19:16 2009 +0100| [c1986e205c1488d2aa55750bb67c33c883873013] | committer: Laurent Aimar 

Fixed playlist_IsEmpty usage.

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).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1986e205c1488d2aa55750bb67c33c883873013
---

 modules/gui/skins2/commands/cmd_input.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/gui/skins2/commands/cmd_input.cpp b/modules/gui/skins2/commands/cmd_input.cpp
index 0aafe14..76a8eab 100644
--- a/modules/gui/skins2/commands/cmd_input.cpp
+++ b/modules/gui/skins2/commands/cmd_input.cpp
@@ -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




More information about the vlc-devel mailing list