mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-08 20:58:41 +00:00
avplayer: do not start the video multiple times (#3638)
This commit is contained in:
committed by
GitHub
parent
51c96b8ee6
commit
525d24a7fc
@@ -176,13 +176,18 @@ bool AvPlayerState::GetStreamInfo(u32 stream_index, AvPlayerStreamInfo& info) {
|
||||
// Called inside GAME thread
|
||||
bool AvPlayerState::Start() {
|
||||
std::shared_lock lock(m_source_mutex);
|
||||
if (m_up_source == nullptr || !m_up_source->Start()) {
|
||||
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
||||
return false;
|
||||
if (m_current_state == AvState::Ready || m_current_state == AvState::Stop || Stop()) {
|
||||
if (!m_up_source->Start()) {
|
||||
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
||||
return false;
|
||||
}
|
||||
SetState(AvState::Play);
|
||||
OnPlaybackStateChanged(AvState::Play);
|
||||
return true;
|
||||
}
|
||||
SetState(AvState::Play);
|
||||
OnPlaybackStateChanged(AvState::Play);
|
||||
return true;
|
||||
|
||||
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called inside GAME thread
|
||||
|
||||
Reference in New Issue
Block a user