From 0e110720709beddb9918431f1324b4bef0737f38 Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Thu, 30 Oct 2025 23:28:00 +0100 Subject: [PATCH] BugFix Set media player speed on session load and Rewind (allows start with negative playspeed) --- src/SessionCreator.cpp | 9 ++++++--- src/SourceCallback.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SessionCreator.cpp b/src/SessionCreator.cpp index 2b462e5..ba49d24 100644 --- a/src/SessionCreator.cpp +++ b/src/SessionCreator.cpp @@ -1156,10 +1156,13 @@ void SessionLoader::visit (MediaSource& s) // set config media player s.mediaplayer()->accept(*this); - // add a callback to activate play speed + // read source play speed from media player SessionLoader::visit double r = s.mediaplayer()->playSpeed(); - s.mediaplayer()->setRate(1.0); // reset to normal speed - s.call( new PlaySpeed( r, 100 ) ); + // reset media player to normal speed + s.mediaplayer()->setRate(1.0); + // add a callback to activate source play speed and rewind + s.call( new PlaySpeed( r ) ); + s.call( new RePlay( ) ); } void SessionLoader::visit (SessionFileSource& s) diff --git a/src/SourceCallback.cpp b/src/SourceCallback.cpp index ad260a8..05ea61b 100644 --- a/src/SourceCallback.cpp +++ b/src/SourceCallback.cpp @@ -541,7 +541,7 @@ void RePlay::update(Source *s, float dt) SourceCallback::update(s, dt); // apply when ready - if ( status_ == READY ){ + if ( status_ == READY && s->ready()){ // call replay function s->replay();