[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 15:35:40 CET 2008


vlc | branch: 0.9-bugfix | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Fri Nov 21 10:21:31 2008 +0100| [17014fad90c436ac07cb5688e71a4777a7b8398f] | committer: Jean-Paul Saman 

Enable rc fastforward and rewind commands for RTSP trickplay.
(cherry picked from commit bda9ff6d9630e4319459e1a065ab422b33f5267b)

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

 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 d2e41f6..2d739c8 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -1088,15 +1088,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