mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibVideo: Don't shadow m_playing
in ResumingStateHandler classes
StartingStateHandler and SeekingStateHandler were declaring their own `bool m_playing` fields (from previous code where there was no base class). In the case of SeekingStateHandler, this only made the logging wrong. For StartingStateHandler, however, this meant that it was not using the boolean passed as a parameter to the constructor to define the state that would be transitioned to after the Starting state finished. This meant that when the Stopping state replaced itself with the Starting state, playback would not resume when Starting state exits.
This commit is contained in:
parent
5abffc9c5a
commit
969c987787
1 changed files with 1 additions and 18 deletions
|
@ -388,24 +388,8 @@ class PlaybackManager::StartingStateHandler : public PlaybackManager::ResumingSt
|
|||
manager().m_next_frame.emplace(manager().m_frame_queue->dequeue());
|
||||
manager().m_decode_timer->start(0);
|
||||
dbgln_if(PLAYBACK_MANAGER_DEBUG, "Displayed frame at {}ms, emplaced second frame at {}ms, finishing start now", manager().m_last_present_in_media_time.to_milliseconds(), manager().m_next_frame->timestamp().to_milliseconds());
|
||||
if (!m_playing)
|
||||
return replace_handler_and_delete_this<PausedStateHandler>();
|
||||
return replace_handler_and_delete_this<PlayingStateHandler>();
|
||||
return assume_next_state();
|
||||
}
|
||||
|
||||
ErrorOr<void> play() override
|
||||
{
|
||||
m_playing = true;
|
||||
return {};
|
||||
}
|
||||
bool is_playing() override { return m_playing; };
|
||||
ErrorOr<void> pause() override
|
||||
{
|
||||
m_playing = false;
|
||||
return {};
|
||||
}
|
||||
|
||||
bool m_playing { false };
|
||||
};
|
||||
|
||||
class PlaybackManager::PlayingStateHandler : public PlaybackManager::PlaybackStateHandler {
|
||||
|
@ -661,7 +645,6 @@ private:
|
|||
return skip_samples_until_timestamp();
|
||||
}
|
||||
|
||||
bool m_playing { false };
|
||||
Time m_target_timestamp { Time::zero() };
|
||||
SeekMode m_seek_mode { SeekMode::Accurate };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue