Instead of using a playback state to initiate and wake from suspension, suspend the decoders themselves based on the time since the last status check or pull. This allows audio and video to suspend independently, and fixes videos getting stuck after suspension due to the waking seeks being skipped downstream of the decoder, leaving the decoder suspended.
23 lines
525 B
C++
23 lines
525 B
C++
/*
|
|
* Copyright (c) 2025-2026, Gregory Bertilson <gregory@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "ResumingStateHandler.h"
|
|
|
|
#include <LibMedia/PlaybackManager.h>
|
|
#include <LibMedia/PlaybackStates/PausedStateHandler.h>
|
|
#include <LibMedia/PlaybackStates/PlayingStateHandler.h>
|
|
|
|
namespace Media {
|
|
|
|
void ResumingStateHandler::resume()
|
|
{
|
|
if (m_playing)
|
|
manager().replace_state_handler<PlayingStateHandler>();
|
|
else
|
|
manager().replace_state_handler<PausedStateHandler>();
|
|
}
|
|
|
|
}
|