[vlc-devel] [PATCH] fixed .play(void) after .playlist.add();

Sergey Radionov rsatom at gmail.com
Sun Sep 30 10:31:06 CEST 2012


---
 common/vlc_player.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/vlc_player.cpp b/common/vlc_player.cpp
index 619f13d..2b07155 100644
--- a/common/vlc_player.cpp
+++ b/common/vlc_player.cpp
@@ -167,8 +167,15 @@ void vlc_player::play()
     if( !is_open() )
         return;
 
-    libvlc_media_list_player_play(_ml_p);
-    on_player_action(pa_play);
+    if( 0 == items_count() )
+        return;
+    else if( -1 == current_item() ) {
+        play(0);
+    }
+    else {
+        libvlc_media_list_player_play(_ml_p);
+        on_player_action(pa_play);
+    }
 }
 
 bool vlc_player::play(unsigned int idx)
-- 
1.7.11.msysgit.1




More information about the vlc-devel mailing list