[vlc-devel] commit: Allowing for rate < 0 enables rewind playback for eg: RTSP streams. (Jean-Paul Saman )

git version control git at videolan.org
Thu Nov 20 16:18:26 CET 2008


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Wed Nov 19 16:07:34 2008 +0100| [f76cff41026a8c812644a57db33c4d2d846cf55a] | committer: Jean-Paul Saman 

Allowing for rate < 0 enables rewind playback for eg: RTSP streams.

Don't allow rate < 0 when p_input->p->input.b_rescale_ts is true.
Setting b_rescale_ts to true says to vlc, rescale the timestamp.
Setting it to false is like saying, I can completely handle the rate, just aknoledge the fact that the rate is not the default one.

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

 src/input/input.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index e3b7b03..b8fe946 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -156,6 +156,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
     msg_Dbg( p_input, "Creating an input for '%s'", psz_name);
 
     free( psz_name );
+    psz_name = NULL;
 
     /* Start a timer to mesure how long it takes
      * to launch an input */
@@ -1532,6 +1533,7 @@ static void ControlPause( input_thread_t *p_input, mtime_t i_control_date )
     input_ChangeStateWithVarCallback( p_input, i_state, false );
 
 }
+
 static void ControlUnpause( input_thread_t *p_input, mtime_t i_control_date )
 {
     int i_ret = VLC_SUCCESS;
@@ -1763,7 +1765,12 @@ static bool Control( input_thread_t *p_input, int i_type,
                 }
             }
 
-            if( i_rate < INPUT_RATE_MIN )
+            if( (i_rate < 0) && p_input->p->input.b_rescale_ts )
+            {
+                msg_Dbg( p_input, "cannot set negative rate" );
+                i_rate = INPUT_RATE_MIN;
+            }
+            else if( (i_rate > 0) && (i_rate < INPUT_RATE_MIN) )
             {
                 msg_Dbg( p_input, "cannot set rate faster" );
                 i_rate = INPUT_RATE_MIN;




More information about the vlc-devel mailing list