Instead of tracking in-flight seeks across all the sinks in the seeking state handler, move the logic to PlaybackManager to determine the overall status and then notify the state of that status to potentially trigger resumption. The buffering state handler can then share essentially the same logic instead of having the playback manager specifically track the blocked tracks for it.
29 lines
516 B
C++
29 lines
516 B
C++
/*
|
|
* Copyright (c) 2026-present, the Ladybird developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "StartingStateHandler.h"
|
|
|
|
#include <LibMedia/PlaybackManager.h>
|
|
|
|
namespace Media {
|
|
|
|
void StartingStateHandler::start()
|
|
{
|
|
m_started = true;
|
|
|
|
if (!m_pipeline_blocked)
|
|
resume();
|
|
}
|
|
|
|
void StartingStateHandler::on_pipeline_status_changed(PipelineStatus status)
|
|
{
|
|
m_pipeline_blocked = status == PipelineStatus::Blocked;
|
|
|
|
if (m_started && !m_pipeline_blocked)
|
|
resume();
|
|
}
|
|
|
|
}
|