]> git.sesse.net Git - vlc/commitdiff
* Fixed VLC_IsPlaying (fixes #259)
authorDerk-Jan Hartman <hartman@videolan.org>
Wed, 10 Aug 2005 22:31:12 +0000 (22:31 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Wed, 10 Aug 2005 22:31:12 +0000 (22:31 +0000)
  Now uses the state variable instead of playlist_IsPlaying. The PLAYLIST_PAUSED state is no longer reliable since the introduction of the state variable for testing if playback is in a paused state. Perhaps we should remove this part of the playlist logic and keep it to RUNNING and STOPPED.

src/libvlc.c

index bd653624da472be7276cfa37b84e1611f1848876..173910b8d6138350c4e2028145b2f0e782767f54 100644 (file)
@@ -1263,6 +1263,7 @@ vlc_bool_t VLC_IsPlaying( int i_object )
 {
     playlist_t * p_playlist;
     vlc_bool_t   b_playing;
+    vlc_value_t  val;
 
     vlc_t *p_vlc = vlc_current_object( i_object );
 
@@ -1279,8 +1280,13 @@ vlc_bool_t VLC_IsPlaying( int i_object )
         if( i_object ) vlc_object_release( p_vlc );
         return VLC_ENOOBJ;
     }
-
-    b_playing = playlist_IsPlaying( p_playlist );
+    if( !p_playlist->p_input )
+    {
+        if( i_object ) vlc_object_release( p_vlc );
+        return VLC_ENOOBJ;
+    }
+    var_Get( p_playlist->p_input, "state", &val );
+    b_playing = ( val.i_int == PLAYING_S );
     vlc_object_release( p_playlist );
 
     if( i_object ) vlc_object_release( p_vlc );