Skip to content
Snippets Groups Projects
Commit b848b8de authored by Thomas Guillem's avatar Thomas Guillem Committed by Steve Lhomme
Browse files

input_clock: add an intermediate rate variable

No functional changes, this is needed by the next commit as
UpdateListener() use cl->rate (and need to be up to date).
parent bdd4ca71
No related branches found
No related tags found
No related merge requests found
...@@ -339,14 +339,16 @@ void input_clock_Reset( input_clock_t *cl ) ...@@ -339,14 +339,16 @@ void input_clock_Reset( input_clock_t *cl )
*****************************************************************************/ *****************************************************************************/
void input_clock_ChangeRate( input_clock_t *cl, float rate ) void input_clock_ChangeRate( input_clock_t *cl, float rate )
{ {
float oldrate = cl->rate;
cl->rate = rate;
if( cl->b_has_reference ) if( cl->b_has_reference )
{ {
/* Move the reference point (as if we were playing at the new rate /* Move the reference point (as if we were playing at the new rate
* from the start */ * from the start */
cl->ref.system = cl->last.system - (vlc_tick_t) ((cl->last.system - cl->ref.system) / rate * cl->rate); cl->ref.system = cl->last.system
- (vlc_tick_t) ((cl->last.system - cl->ref.system) / rate * oldrate);
} }
cl->rate = rate;
UpdateListener( cl, false ); UpdateListener( cl, false );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment