BugFix Set media player speed on session load

and Rewind (allows start with negative playspeed)
This commit is contained in:
brunoherbelin
2025-10-30 23:28:00 +01:00
parent 232dcf3a29
commit 0e11072070
2 changed files with 7 additions and 4 deletions

View File

@@ -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)

View File

@@ -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();