]> git.sesse.net Git - vlc/commitdiff
DBus: Play rewinds at the beginning if there is an active input
authorRafaël Carré <funman@videolan.org>
Sat, 10 May 2008 10:50:00 +0000 (12:50 +0200)
committerRafaël Carré <funman@videolan.org>
Sat, 10 May 2008 10:50:00 +0000 (12:50 +0200)
Fix #1566

modules/control/dbus.c

index 06f716b47c27113b0e33b4d7473f43423f22c7d5..c8075a1f12a9bdd2db16507a813727ac27640bae 100644 (file)
@@ -315,7 +315,22 @@ DBUS_METHOD( Play )
 {
     REPLY_INIT;
     playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
-    playlist_Play( p_playlist );
+
+    PL_LOCK;
+    input_thread_t *p_input = p_playlist->p_input;
+    if( p_input )
+        vlc_object_yield( p_input );
+    PL_UNLOCK;
+
+    if( p_input )
+    {
+        double i_pos = 0;
+        input_Control( p_input, INPUT_SET_POSITION, i_pos );
+        vlc_object_release( p_input );
+    }
+    else
+        playlist_Play( p_playlist );
+
     pl_Release( p_playlist );
     REPLY_SEND;
 }