[vlc-devel] commit: Enable rc fastforward and rewind commands for RTSP trickplay. ( Jean-Paul Saman )
git version control
git at videolan.org
Fri Nov 21 10:58:35 CET 2008
vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Fri Nov 21 10:21:31 2008 +0100| [bda9ff6d9630e4319459e1a065ab422b33f5267b] | committer: Jean-Paul Saman
Enable rc fastforward and rewind commands for RTSP trickplay.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bda9ff6d9630e4319459e1a065ab422b33f5267b
---
modules/control/rc.c | 26 ++++++++++++++++++++++----
1 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/modules/control/rc.c b/modules/control/rc.c
index 7a57396..7ced84f 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -1086,15 +1086,33 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
else if ( !strcmp( psz_cmd, "fastforward" ) )
{
- val.i_int = config_GetInt( p_intf, "key-jump+extrashort" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ if( var_GetBool( p_input, "can-rewind" ) )
+ {
+ int i_rate = var_GetInteger( p_input, "rate" );
+ i_rate = (i_rate < 0) ? -i_rate : i_rate * 2;
+ var_SetInteger( p_input, "rate", i_rate );
+ }
+ else
+ {
+ val.i_int = config_GetInt( p_intf, "key-jump+extrashort" );
+ var_Set( p_intf->p_libvlc, "key-pressed", val );
+ }
vlc_object_release( p_input );
return VLC_SUCCESS;
}
else if ( !strcmp( psz_cmd, "rewind" ) )
{
- val.i_int = config_GetInt( p_intf, "key-jump-extrashort" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ if( var_GetBool( p_input, "can-rewind" ) )
+ {
+ int i_rate = var_GetInteger( p_input, "rate" );
+ i_rate = (i_rate > 0) ? -i_rate : i_rate / 2;
+ var_SetInteger( p_input, "rate", i_rate );
+ }
+ else
+ {
+ val.i_int = config_GetInt( p_intf, "key-jump-extrashort" );
+ var_Set( p_intf->p_libvlc, "key-pressed", val );
+ }
vlc_object_release( p_input );
return VLC_SUCCESS;
}
More information about the vlc-devel
mailing list