mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
avplayer: do not start the video multiple times (#3638)
This commit is contained in:
committed by
GitHub
parent
51c96b8ee6
commit
525d24a7fc
@@ -176,7 +176,8 @@ 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()) {
|
||||||
|
if (!m_up_source->Start()) {
|
||||||
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -185,6 +186,10 @@ bool AvPlayerState::Start() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_ERROR(Lib_AvPlayer, "Could not start playback.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Called inside GAME thread
|
// Called inside GAME thread
|
||||||
bool AvPlayerState::Pause() {
|
bool AvPlayerState::Pause() {
|
||||||
std::shared_lock lock(m_source_mutex);
|
std::shared_lock lock(m_source_mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user