[vlc-devel] commit: DBus: Play rewinds at the beginning if there is an active input ( Rafaël Carré )

git version control git at videolan.org
Sat May 10 12:48:50 CEST 2008


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat May 10 12:50:00 2008 +0200| [29d8a0ba4bc86259c74aed7582a99472b97da16c]

DBus: Play rewinds at the beginning if there is an active input

Fix #1566

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

 modules/control/dbus.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/modules/control/dbus.c b/modules/control/dbus.c
index 06f716b..c8075a1 100644
--- a/modules/control/dbus.c
+++ b/modules/control/dbus.c
@@ -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;
 }




More information about the vlc-devel mailing list