[vlc-devel] commit: skins2: add a way to reset rate to normal speed (trac #2412) ( Erwan Tulou )
git version control
git at videolan.org
Wed Feb 24 12:00:11 CET 2010
vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Wed Feb 24 11:44:11 2010 +0100| [f3efae83adeebb6cd08bfd18ecf4953a1344c4aa] | committer: Erwan Tulou
skins2: add a way to reset rate to normal speed (trac #2412)
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)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f3efae83adeebb6cd08bfd18ecf4953a1344c4aa
---
modules/gui/skins2/commands/cmd_input.cpp | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/modules/gui/skins2/commands/cmd_input.cpp b/modules/gui/skins2/commands/cmd_input.cpp
index e5f01d8..9262c0d 100644
--- a/modules/gui/skins2/commands/cmd_input.cpp
+++ b/modules/gui/skins2/commands/cmd_input.cpp
@@ -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 );
More information about the vlc-devel
mailing list