Commit graph

108 commits

Author SHA1 Message Date
Zangetsu38
1a6c23a584 ngs/(atrac9&player): Prevent infinite loop by checking empty buffer.
- Some app should be send byte count 0 value for indicate stop playing.
2025-04-02 02:50:15 +03:00
Dicot0721
3d53d7cb93 ngs: Fix attempts to allocate huge amounts of memory causing the process to freeze.
- `uint32_t decoded_size` may overflow to a very large number by subtracting a number larger than itself, which causes `data.extra_storage.resize(curr_pos + decoded_size * sizeof(float) * 2)` to try to allocate huge amounts of memory (and the process freezes as a result).
- I'm not actually sure if I wrote it correctly this way, I just referenced the previous line of code, but judging by the results, it works fine.
2025-02-16 02:27:06 +03:00
Pedro Montes Alcalde
4a14d546ba
Tick Tick Tick, thats the sound of 2024 flying by (#3503) 2025-01-19 18:51:43 -03:00
scribam
77abeaa167
vita3k: More cleanup (#3379)
* vita3k: Use C++17 nested namespace definition

* vita3k: Remove redundant call to c_str()

* vita3k: Prefer C++ header

* vita3k: Use structured bindings

* shader: Add explicit fallthrough

* vita3k: Cleanup headers and dependencies

* util: Add WIN32_LEAN_AND_MEAN before <Windows.h>

* modules: Remove redundant 'const' specifier on a constexpr variable

* modules: Remove redundant return statement at the end of a function with a void return type

* clang-format: Use C++20 standard

* vita3k: Insert new line at EOF

* host: rename filesystem.hpp to filesystem.h
2024-09-18 21:48:08 +02:00
scribam
612d1f8d81
vita3k: cleanup (#3357)
* module: add missing pragma once

* cmake/vita3k: delete unused files

* vita3k: delete useless semi-colons

* vita3k: cleanup headers

* audio: add missing override to destructors

* vita3k: fix typos

* external: disable unused curl targets
2024-09-02 13:03:58 +02:00
bookmist
1fda880a94 vita3k: big code cleanup
Improvements
* lang: a bit more verbose error on wrong lang xml

Bugfixes
* kernel/sync_primitives: fix theoretically possible AV
* modules/SceAudio: a bit more correct sceAudioOutSetConfig
* fix wrong objects initialisation ({0} -> {})

Warning fixes
* clang warning: Macro argument should be enclosed in parentheses
[bugprone-macro-parentheses]
* modules: set unsigned type for Sce*ErrorCode enums
* clang warning: variable might be not be initialized
* clang warning: Function returns by const value. Consider returning by non-const value instead.
* clang warning: Prefer transparent functors [modernize-use-transparent-functors]

Refactoring
* io/device: move functions implementation from .h to .cpp file
* vita3k: fix fs::path usage
* clang warning: 'if' statement is unnecessary; deleting null pointer has no effect
* vita3k: use structured bindings and references in for-each-loops
* vita3k: simplify container operations, extract frequent operations to utility functions
* clang⚠️ 'contains' member function can be used
* kernel/sync_primitives: refactoring. drop unused parameter of handle_timeout
* vita3k: drop unused function parameters

* vita3k: fix typecasts
use static_cast instead of reinterpret casts if possible
use correct constants (1/1.0/1.0f)
correct variable types to minimise typecasts
use explicit typecasts (not everywhere)
replace c-style typecasts to c++ style typecasts (not everywhere)
* clang warning: remove redundant typecasts
* clang warning: Cast drops const qualifier

Optimisation
* vita3k: remove unused includes
* clang warning: Constness of returning variable prevents automatic move
[performance-no-automatic-move]
* clang warning: String concatenation results in allocation of unnecessary temporary strings
[performance-inefficient-string-concatenation]
* vita3k: use std::move
* vita3k: optimization. push_back -> emplace_back
* vita3k: fix datatypes to avoid unnesessary conversions
* clang warning: remove unneeded string->c_str->string conversion
* clang warning: The parameter is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
* clang warning: 'find' called with a string literal consisting of a single character
[performance-faster-string-find]
* clang warning: Result of a postfix operator is discarded, consider replacing it with a prefix operator
* clang warning: Pass value parameters by const reference

Code cleanup
* io/io: remove once used variables
* net/posixsocket: remove struct keyword
* vita3k: use raw string literals to avoid excessive escaping
* vita3k: refactoring. replace Ptr<> to pointer in Sce functions
* vita3k: drop unused variables and incorrect comments
* clang warning: readability-inconsistent-declaration-parameter-name
* clang warning: Extra ';' after member function definition
* clang warning: Possible misuse of comma operator (, is used instead of ;)
* clang warning: Algorithm accepting an iterator and a count can be used
* clang warning: Declaration and assignment can be joined
* clang warning: Type trait can be simplified using a template alias or a variable template

* vita3k: cleanup class methods
remove unimplemented (and obviously not used) methods
move deleted methods to public
change empty body to =default
remove auto constructors
set member default values
2024-03-18 15:44:56 +03:00
nishinji
d8b8e069d1
vita3k: typo fixes (#3179) 2024-01-18 11:49:08 +01:00
Pedro Montes Alcalde
34565e3ef4
Vita2024K: Happy 2024 2024-01-01 12:36:32 -03:00
Macdu
7d542171c7
modules/SceNgs: Improve sceNgsAT9GetSectionDetails (#3150) 2023-12-31 10:31:48 +01:00
Macdu
913ba68fa1 ngs: Prevent race conditions in the scheduler 2023-11-27 12:59:55 +01:00
Macdu
770fb206dd ngs: Improve player/atrac9 transition 2023-11-27 12:59:55 +01:00
Macdu
acb2b776cf
ngs: Duplicate info buffers (#3090) 2023-11-21 15:55:12 +01:00
Macdu
6f35f1a3ab vita3k: Use LOG_..._ONCE when appropriate 2023-10-10 16:31:47 +02:00
Macdu
47d29bdce9 ngs: Improve support for mono voices 2023-10-09 22:25:16 +02:00
Macdu
93000acbc3 ngs: Fix patches with a mono source 2023-10-06 15:56:54 +02:00
bookmist
810c3aeacd ngs: return error and workaround crashes on invalid configurations
util/log: LOG_*_ONCE macros
modules/SceNgs: implement sceNgsVoiceGetModuleType
modules/SceNgs: return error on incomplete output paths and null voice definition
ngs/modules/player: workaround crash if required playback frequency is invalid
2023-09-23 23:31:16 +03:00
Macdu
ddb7bd96b7 ngs: Double param buffer size for the equalizer 2023-06-27 20:42:55 +02:00
Macdu
1dd62b23fe ngs: Save Atrac9 decoder state 2023-06-22 09:23:02 +02:00
Macdu
82dabe806a ngs: Stub all audio modules 2023-06-20 11:42:34 +02:00
Macdu
745292f606 ngs: Big refractor 2023-06-20 11:42:34 +02:00
bookmist
4ba2e086cc Vita3K: code cleanup and optimisations 2023-05-10 15:31:55 +03:00
Macdu
82ca4b6614 external/codec: Update ffmpeg 2023-04-13 12:03:40 +02:00
Macdu
e83cb54ac2 ngs: Return correct number of samples 2023-03-30 01:26:29 +02:00
EXtremeExploit
41a17e79c7 Planet Earth Season 2023 2023-01-02 10:46:20 +01:00
bookmist
8edd333400 Fix compiler warnings 2022-11-16 21:39:55 +03:00
Macdu
2e5f156229 ngs: Fix resampling for Atrac9 player 2022-10-22 13:43:01 +02:00
Macdu
636b1dfedd kernel: Rewrite the way svc and callbacks are handled 2022-09-16 21:57:57 +02:00
Pedro Montes Alcalde
2827e1d2ce
vita3k: Fix some compiler warnings (#1972) 2022-07-25 01:05:27 -03:00
Macdu
086c6f9515
codec, ngs: Fix race condition with swr and adpcm history (#1946) 2022-07-12 23:31:43 -03:00
korenkonder
4c4adf1c46
audio: Fix ADPCM decoding (#1883) 2022-06-24 13:54:22 +02:00
Macdu
a8bf70e74d ngs: Fix Atrac9 crash when data sent has header 2022-06-18 02:50:39 +02:00
Pedro Montes Alcalde
e8151664b7
cmake: Treat format-secutiry warnings as errors (#1667) 2022-06-12 01:03:43 -03:00
Macdu
58044ca42b ngs: Clear voice memory location when initializing it 2022-06-11 23:58:44 +02:00
Zangetsu38
37241b1f45 ngs/atrac9: delete warn of playback scalar. 2022-06-07 01:02:47 +02:00
Macdu
ba95261acb ngs: Implement playback rate in the Atrac9 player 2022-06-04 20:08:37 +02:00
Macdu
37c9be4625 ngs: Pass proper argument to buffer swap callback 2022-06-04 02:07:10 +02:00
Macdu
4093f9a174 ngs: Implement atrac9 start and end sample skip 2022-06-03 20:15:31 +02:00
Macdu
0e0a3c3982 modules/SceNgsUser: Implement release functions 2022-06-02 20:50:01 +02:00
Macdu
aa65dc2391 external, ngs: Remove playback_rate and soundtouch 2022-05-24 16:59:22 +02:00
Macdu
14cc5604b8 ngs: Fix player modules behavior 2022-05-24 16:59:22 +02:00
Macdu
d1dfdd7b1c ngs: Better handling of voice state 2022-05-24 16:59:22 +02:00
Zangetsu38
ffa66d88de ngs: stub voice definition of Buss Scream(Player/At9). 2022-05-21 15:27:47 +02:00
Macdu
1658c62e31 ngs: Fix parse_params and add missing checks 2022-05-21 14:28:33 +02:00
Macdu
b0cbdea184 ngs: Implement new functions 2022-05-20 19:39:46 +02:00
Macdu
fc66f1514a ngs: Fix get_buffer_parameter 2022-05-19 02:20:52 +02:00
Macdu
b289ad9056 ngs: Fix softlock happening when calling update 2022-05-19 00:58:17 +02:00
Macdu
71df446f34 ngs: Fix VoiceState and sceNgsVoiceKeyOff 2022-05-18 23:18:25 +02:00
Macdu
617c1921df ngs: Fix broken Atrac9 2022-05-13 14:57:06 +02:00
Macdu
cc63c381ba modules/SceAudiodec: implement sceAudiodecClearContext 2022-05-12 00:48:55 +02:00
Macdu
ba48660859 codec: Fix Atrac9 2022-05-12 00:48:55 +02:00