[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:19:32 CET 2008


vlc | branch: 0.9-bugfix | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Wed Nov 19 16:07:34 2008 +0100| [76cfaf8a84620ad53f5b08142e4251c90bdf7f36] | 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.

(cherry picked from commit: ba6ebdc85b2738f46510e69812295a27e211b3c6)

Signed-off-by: Jean-Paul Saman <jpsaman at videolan.org>

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

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

diff --git a/src/input/input.c b/src/input/input.c
index 6840657..5694ead 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -146,6 +146,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 */
@@ -1646,7 +1647,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