[PR #1200] [MERGED] Refactor audio handling with range checks, buffer threshold, and lock… #1987

Closed
opened 2026-02-27 21:14:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1200
Author: @Mikasa-san
Created: 10/2/2024
Status: Merged
Merged: 10/2/2024
Merged by: @georgemoralis

Base: mainHead: main


📝 Commits (2)

  • d63b7fc Refactor audio handling with range checks, buffer threshold, and lock fixes
  • 4a6922b Refactor audio handling with range checks, buffer threshold, and lock fixes

📊 Changes

1 file changed (+28 additions, -10 deletions)

View changed files

📝 src/audio_core/sdl_audio.cpp (+28 -10)

📄 Description

… fixes

  • Added range checks for handle to avoid invalid index access in AudioOutOutput, AudioOutSetVolume, and AudioOutGetStatus.

  • Added a constant AUDIO_STREAM_BUFFER_THRESHOLD for the buffer threshold (was previously a magic number).

  • Set the freq parameter correctly in the SDL_AudioSpec structure in AudioOutOpen.

  • Fixed locking issues in AudioOutOutput to avoid unlocking before it's locked.

Edit

  • Ensure that port.stream and other large objects are being managed efficiently, either with smart pointers or explicit cleanup to avoid memory leaks.

  • Removes tab spaces to fix clang-format error


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1200 **Author:** [@Mikasa-san](https://github.com/Mikasa-san) **Created:** 10/2/2024 **Status:** ✅ Merged **Merged:** 10/2/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`d63b7fc`](https://github.com/shadps4-emu/shadPS4/commit/d63b7fcc1d3d443c102b9dea9ac4906cb9357af0) Refactor audio handling with range checks, buffer threshold, and lock fixes - [`4a6922b`](https://github.com/shadps4-emu/shadPS4/commit/4a6922bcce645385d00c130395cd9b2067395458) Refactor audio handling with range checks, buffer threshold, and lock fixes ### 📊 Changes **1 file changed** (+28 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/audio_core/sdl_audio.cpp` (+28 -10) </details> ### 📄 Description … fixes - Added range checks for handle to avoid invalid index access in AudioOutOutput, AudioOutSetVolume, and AudioOutGetStatus. - Added a constant AUDIO_STREAM_BUFFER_THRESHOLD for the buffer threshold (was previously a magic number). - Set the freq parameter correctly in the SDL_AudioSpec structure in AudioOutOpen. - Fixed locking issues in AudioOutOutput to avoid unlocking before it's locked. Edit - Ensure that port.stream and other large objects are being managed efficiently, either with smart pointers or explicit cleanup to avoid memory leaks. - Removes tab spaces to fix clang-format error --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:14:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#1987
No description provided.