mirror of
https://github.com/clangen/musikcube.git
synced 2025-02-06 12:39:54 +00:00
Don't cache playback position for streams of indeterminate length.
This commit is contained in:
parent
445e128269
commit
20d277b408
@ -107,7 +107,11 @@ namespace musik {
|
||||
if (prefs->GetBool(keys::SaveSessionOnExit, true)) {
|
||||
if (playback.GetPlaybackState() != sdk::PlaybackStopped) {
|
||||
prefs->SetInt(keys::LastPlayQueueIndex, (int)playback.GetIndex());
|
||||
prefs->SetDouble(keys::LastPlayQueueTime, playback.GetPosition());
|
||||
|
||||
/* streams with a negative duration are of indeterminate length,
|
||||
and may be infinite, so don't cache the playback position */
|
||||
double offset = playback.GetDuration() > 0.0 ? playback.GetPosition() : 0.0;
|
||||
prefs->SetDouble(keys::LastPlayQueueTime, offset);
|
||||
}
|
||||
else {
|
||||
prefs->SetInt(keys::LastPlayQueueIndex, -1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user