From faea291295fd73c41fedb074201e868b503eb3e8 Mon Sep 17 00:00:00 2001 From: Vladislav Mikhalin Date: Mon, 16 Sep 2024 12:54:20 +0300 Subject: [PATCH] Do not wait for audio packets without audio stream (#939) --- src/core/libraries/avplayer/avplayer_impl.h | 2 -- src/core/libraries/avplayer/avplayer_source.cpp | 3 ++- src/core/libraries/avplayer/avplayer_state.h | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/libraries/avplayer/avplayer_impl.h b/src/core/libraries/avplayer/avplayer_impl.h index 09989d39..b6ad940c 100644 --- a/src/core/libraries/avplayer/avplayer_impl.h +++ b/src/core/libraries/avplayer/avplayer_impl.h @@ -40,8 +40,6 @@ public: bool SetLooping(bool is_looping); private: - using ScePthreadMutex = Kernel::ScePthreadMutex; - // Memory Replacement static void* PS4_SYSV_ABI Allocate(void* handle, u32 alignment, u32 size); static void PS4_SYSV_ABI Deallocate(void* handle, void* memory); diff --git a/src/core/libraries/avplayer/avplayer_source.cpp b/src/core/libraries/avplayer/avplayer_source.cpp index 603d5501..51c37df0 100644 --- a/src/core/libraries/avplayer/avplayer_source.cpp +++ b/src/core/libraries/avplayer/avplayer_source.cpp @@ -439,7 +439,8 @@ void AvPlayerSource::DemuxerThread(std::stop_token stop) { LOG_INFO(Lib_AvPlayer, "Demuxer Thread started"); while (!stop.stop_requested()) { - if (m_video_packets.Size() > 30 && m_audio_packets.Size() > 8) { + if (m_video_packets.Size() > 30 && + (!m_audio_stream_index.has_value() || m_audio_packets.Size() > 8)) { std::this_thread::sleep_for(milliseconds(5)); continue; } diff --git a/src/core/libraries/avplayer/avplayer_state.h b/src/core/libraries/avplayer/avplayer_state.h index a5a3bd68..7a15eaf8 100644 --- a/src/core/libraries/avplayer/avplayer_state.h +++ b/src/core/libraries/avplayer/avplayer_state.h @@ -38,9 +38,6 @@ public: bool SetLooping(bool is_looping); private: - using ScePthreadMutex = Kernel::ScePthreadMutex; - using ScePthread = Kernel::ScePthread; - // Event Replacement static void PS4_SYSV_ABI AutoPlayEventCallback(void* handle, s32 event_id, s32 source_id, void* event_data);