mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-09 21:31:04 +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
|
// Called inside GAME thread
|
||||||
bool AvPlayerState::Start() {
|
bool AvPlayerState::Start() {
|
||||||
std::shared_lock lock(m_source_mutex);
|
std::shared_lock lock(m_source_mutex);
|
||||||
if (m_up_source == nullptr || !m_up_source->Start()) {
|
if (m_current_state == AvState::Ready || m_current_state == AvState::Stop || Stop()) {
|
||||||
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
if (!m_up_source->Start()) {
|
||||||
return false;
|
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SetState(AvState::Play);
|
||||||
|
OnPlaybackStateChanged(AvState::Play);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
SetState(AvState::Play);
|
|
||||||
OnPlaybackStateChanged(AvState::Play);
|
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called inside GAME thread
|
// Called inside GAME thread
|
||||||
|
|||||||
Reference in New Issue
Block a user