Skip to content

Commit

Permalink
fixing build on linux and mac
Browse files Browse the repository at this point in the history
  • Loading branch information
roamic committed Aug 14, 2024
1 parent 564febf commit 6835b9b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
10 changes: 7 additions & 3 deletions src/audio_core/sdl_audio.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include "sdl_audio.h"

#include "common/assert.h"
#include "core/libraries/error_codes.h"

#include <SDL3/SDL_audio.h>
#include <SDL3/SDL_init.h>
#include <SDL3/SDL_timer.h>
#include "common/assert.h"
#include "core/libraries/error_codes.h"
#include "sdl_audio.h"

#include <mutex> // std::unique_lock

namespace Audio {

Expand Down
7 changes: 0 additions & 7 deletions src/core/libraries/avplayer/avplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "core/libraries/kernel/thread_management.h"
#include "core/libraries/libs.h"

#include <algorithm> // std::max, std::min

namespace Libraries::AvPlayer {

using namespace Kernel;
Expand Down Expand Up @@ -119,11 +117,6 @@ bool PS4_SYSV_ABI sceAvPlayerGetVideoDataEx(SceAvPlayerHandle handle,
return res;
}

constexpr u32 GetPriority(u32 base, u32 offset) {
// (27D <= base_priority <= 2FC) + offset <= 2FF
return std::min(std::min(std::max(637u, base), 764u) + offset, 767u);
}

SceAvPlayerHandle PS4_SYSV_ABI sceAvPlayerInit(SceAvPlayerInitData* data) {
LOG_TRACE(Lib_AvPlayer, "called");
if (data == nullptr) {
Expand Down
6 changes: 3 additions & 3 deletions src/core/libraries/avplayer/avplayer_file_streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ s64 AvPlayerFileStreamer::Seek(void* opaque, s64 offset, int whence) {

if (whence == SEEK_CUR) {
self->m_position =
std::min(u64(std::max(0i64, s64(self->m_position) + offset)), self->m_file_size);
std::min(u64(std::max(s64(0), s64(self->m_position) + offset)), self->m_file_size);
return self->m_position;
} else if (whence == SEEK_SET) {
self->m_position = std::min(u64(std::max(0i64, offset)), self->m_file_size);
self->m_position = std::min(u64(std::max(s64(0), offset)), self->m_file_size);
return self->m_position;
} else if (whence == SEEK_END) {
self->m_position =
std::min(u64(std::max(0i64, s64(self->m_file_size) + offset)), self->m_file_size);
std::min(u64(std::max(s64(0), s64(self->m_file_size) + offset)), self->m_file_size);
return self->m_position;
}

Expand Down
3 changes: 1 addition & 2 deletions src/core/libraries/avplayer/avplayer_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
#include "avplayer_data_streamer.h"

#include "common/types.h"
#include "common/polyfill_thread.h"
#include "core/libraries/kernel/thread_management.h"

#include <atomic>
#include <chrono>
#include <mutex>
#include <optional>
#include <stop_token>
#include <string>
#include <thread>

struct AVCodecContext;
struct AVFormatContext;
Expand Down
3 changes: 1 addition & 2 deletions src/core/libraries/avplayer/avplayer_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
#include "avplayer_data_streamer.h"
#include "avplayer_source.h"

#include "common/polyfill_thread.h"
#include "core/libraries/kernel/thread_management.h"

#include <memory>
#include <mutex>
#include <stop_token>
#include <thread>

namespace Libraries::AvPlayer {

Expand Down
5 changes: 2 additions & 3 deletions src/core/libraries/save_data/savedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,11 +792,10 @@ int PS4_SYSV_ABI sceSaveDataTransferringMount() {
}

s32 PS4_SYSV_ABI sceSaveDataUmount(const OrbisSaveDataMountPoint* mountPoint) {
if (mountPoint->data == nullptr) {
LOG_WARNING(Lib_SaveData, "mountPoint = nullptr");
LOG_INFO(Lib_SaveData, "mountPoint = {}", mountPoint->data);
if (std::string_view(mountPoint->data).empty()) {
return ORBIS_SAVE_DATA_ERROR_NOT_MOUNTED;
}
LOG_INFO(Lib_SaveData, "mountPoint = {}", mountPoint->data);
const auto& mount_dir = Common::FS::GetUserPath(Common::FS::PathType::SaveDataDir) /
std::to_string(1) / game_serial / mountPoint->data;
auto* mnt = Common::Singleton<Core::FileSys::MntPoints>::Instance();
Expand Down

0 comments on commit 6835b9b

Please sign in to comment.