From 52fcc73bd42c3cb4bb234458eec59852b9a1b926 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 15 Sep 2022 04:48:53 +0200 Subject: [PATCH] early-access version 2950 --- README.md | 2 +- dist/AppRun | 28 +++++++++++++++++++ .../renderer/command/effect/compressor.cpp | 11 ++++---- src/audio_core/sink/cubeb_sink.cpp | 6 ++-- src/audio_core/sink/sdl2_sink.cpp | 4 +-- src/audio_core/sink/sink_stream.h | 2 -- src/core/hle/service/ldn/lan_discovery.cpp | 12 +++----- 7 files changed, 42 insertions(+), 23 deletions(-) create mode 100755 dist/AppRun diff --git a/README.md b/README.md index 0c251d834..d5888061c 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2948. +This is the source code for early-access 2950. ## Legal Notice diff --git a/dist/AppRun b/dist/AppRun new file mode 100755 index 000000000..f4b29d482 --- /dev/null +++ b/dist/AppRun @@ -0,0 +1,28 @@ +#!/bin/sh -e +# SPDX-FileCopyrightText: 2022 +# SPDX-License-Identifier: MIT +# From: https://github.com/darealshinji/AppImageKit-checkrt + +# add your command to execute here +exec=yuzu + +cd "$(dirname "$0")" +if [ "x$exec" = "x" ]; then + exec="$(sed -n 's|^Exec=||p' *.desktop | head -1)" +fi +if [ -x "./usr/optional/checkrt" ]; then + extra_libs="$(./usr/optional/checkrt)" +fi +if [ -n "$extra_libs" ]; then + export LD_LIBRARY_PATH="${extra_libs}${LD_LIBRARY_PATH}" + if [ -e "$PWD/usr/optional/exec.so" ]; then + export LD_PRELOAD="$PWD/usr/optional/exec.so:${LD_PRELOAD}" + fi +fi + +export SSL_CERT_FILE="$PWD/ca-certificates.pem" +#echo ">>>>> $LD_LIBRARY_PATH" +#echo ">>>>> $LD_PRELOAD" + +./usr/bin/$exec "$*" +exit $? diff --git a/src/audio_core/renderer/command/effect/compressor.cpp b/src/audio_core/renderer/command/effect/compressor.cpp index 2ebc140f1..7229618e8 100755 --- a/src/audio_core/renderer/command/effect/compressor.cpp +++ b/src/audio_core/renderer/command/effect/compressor.cpp @@ -11,7 +11,7 @@ namespace AudioCore::AudioRenderer { -static void SetCompressorEffectParameter(CompressorInfo::ParameterVersion2& params, +static void SetCompressorEffectParameter(const CompressorInfo::ParameterVersion2& params, CompressorInfo::State& state) { const auto ratio{1.0f / params.compressor_ratio}; auto makeup_gain{0.0f}; @@ -31,9 +31,9 @@ static void SetCompressorEffectParameter(CompressorInfo::ParameterVersion2& para state.unk_20 = c; } -static void InitializeCompressorEffect(CompressorInfo::ParameterVersion2& params, +static void InitializeCompressorEffect(const CompressorInfo::ParameterVersion2& params, CompressorInfo::State& state) { - std::memset(&state, 0, sizeof(CompressorInfo::State)); + state = {}; state.unk_00 = 0; state.unk_04 = 1.0f; @@ -42,7 +42,7 @@ static void InitializeCompressorEffect(CompressorInfo::ParameterVersion2& params SetCompressorEffectParameter(params, state); } -static void ApplyCompressorEffect(CompressorInfo::ParameterVersion2& params, +static void ApplyCompressorEffect(const CompressorInfo::ParameterVersion2& params, CompressorInfo::State& state, bool enabled, std::vector> input_buffers, std::vector> output_buffers, u32 sample_count) { @@ -103,8 +103,7 @@ static void ApplyCompressorEffect(CompressorInfo::ParameterVersion2& params, } else { for (s16 channel = 0; channel < params.channel_count; channel++) { if (params.inputs[channel] != params.outputs[channel]) { - std::memcpy((char*)output_buffers[channel].data(), - (char*)input_buffers[channel].data(), + std::memcpy(output_buffers[channel].data(), input_buffers[channel].data(), output_buffers[channel].size_bytes()); } } diff --git a/src/audio_core/sink/cubeb_sink.cpp b/src/audio_core/sink/cubeb_sink.cpp index 4fca664b1..36b115ad6 100755 --- a/src/audio_core/sink/cubeb_sink.cpp +++ b/src/audio_core/sink/cubeb_sink.cpp @@ -133,10 +133,10 @@ public: return; } + paused = false; if (cubeb_stream_start(stream_backend) != CUBEB_OK) { LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream"); } - paused = false; } /** @@ -149,12 +149,10 @@ public: return; } + paused = true; if (cubeb_stream_stop(stream_backend) != CUBEB_OK) { LOG_CRITICAL(Audio_Sink, "Error stopping cubeb stream"); } - - was_playing.store(!paused); - paused = true; } private: diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index b7dcf02ff..1bd001b94 100755 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp @@ -112,8 +112,8 @@ public: return; } - SDL_PauseAudioDevice(device, 0); paused = false; + SDL_PauseAudioDevice(device, 0); } /** @@ -124,8 +124,8 @@ public: if (device == 0 || paused) { return; } - SDL_PauseAudioDevice(device, 1); paused = true; + SDL_PauseAudioDevice(device, 1); } private: diff --git a/src/audio_core/sink/sink_stream.h b/src/audio_core/sink/sink_stream.h index db7cff45e..9aada54f1 100755 --- a/src/audio_core/sink/sink_stream.h +++ b/src/audio_core/sink/sink_stream.h @@ -220,8 +220,6 @@ protected: u32 device_channels{2}; /// Is this stream currently paused? std::atomic paused{true}; - /// Was this stream previously playing? - std::atomic was_playing{false}; /// Name of this stream std::string name{}; diff --git a/src/core/hle/service/ldn/lan_discovery.cpp b/src/core/hle/service/ldn/lan_discovery.cpp index c8eb2b507..5f3222217 100755 --- a/src/core/hle/service/ldn/lan_discovery.cpp +++ b/src/core/hle/service/ldn/lan_discovery.cpp @@ -592,14 +592,10 @@ bool LANDiscovery::IsFlagSet(ScanFilterFlag flag, ScanFilterFlag search_flag) co } int LANDiscovery::GetStationCount() const { - int count = 0; - for (const auto& station : stations) { - if (station.GetStatus() != NodeStatus::Disconnected) { - count++; - } - } - - return count; + return static_cast( + std::count_if(stations.begin(), stations.end(), [](const auto& station) { + return station.GetStatus() != NodeStatus::Disconnected; + })); } MacAddress LANDiscovery::GetFakeMac() const {