Do not wait for audio packets without audio stream (#939)

This commit is contained in:
Vladislav Mikhalin 2024-09-16 12:54:20 +03:00 committed by GitHub
parent dcf245b814
commit faea291295
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 6 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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);