]> git.sesse.net Git - vlc/commitdiff
Allowing for rate < 0 enables rewind playback for eg: RTSP streams.
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Wed, 19 Nov 2008 15:07:34 +0000 (16:07 +0100)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Thu, 20 Nov 2008 15:17:45 +0000 (16:17 +0100)
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.

src/input/input.c

index e3b7b03dafe3d2e7edf111d39d8fbc426119c61b..b8fe94652f7714be2b210176c87e75514102d1bc 100644 (file)
@@ -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;