]> git.sesse.net Git - vlc/commitdiff
skins2: add a way to reset rate to normal speed (trac #2412)
authorErwan Tulou <erwan10@videolan.org>
Wed, 24 Feb 2010 10:44:11 +0000 (11:44 +0100)
committerErwan Tulou <erwan10@videolan.org>
Wed, 24 Feb 2010 10:58:30 +0000 (11:58 +0100)
Skins did not offer a simple way to get back to normal speed
once user had clicked several times on either slower or faster
rates.

This patch automatically resets rate to normal if user presses play/pause
when an input is already launched. (as suggested in trac #2412)

modules/gui/skins2/commands/cmd_input.cpp

index e5f01d800ac71c5f04e3ce1a5208284f36af2d72..9262c0d36a9e013a983d61405b65b8344d082806 100644 (file)
@@ -34,6 +34,14 @@ void CmdPlay::execute()
     if( pPlaylist == NULL )
         return;
 
+    // if already playing an input, reset rate to normal speed
+    input_thread_t *pInput = playlist_CurrentInput( pPlaylist );
+    if( pInput )
+    {
+        var_SetFloat( pInput, "rate", 1.0 );
+        vlc_object_release( pInput );
+    }
+
     playlist_Lock( pPlaylist );
     const bool b_empty = playlist_IsEmpty( pPlaylist );
     playlist_Unlock( pPlaylist );