mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-10 03:31:30 -06:00
Merge branch 'main' into user_and_settings
This commit is contained in:
commit
fb4ca27022
@ -55,7 +55,7 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view path, bool* is_rea
|
||||
if (path.length() > 255)
|
||||
return "";
|
||||
|
||||
const MntPair* mount = GetMount(corrected_path);
|
||||
const std::optional<MntPair> mount = GetMount(corrected_path);
|
||||
if (!mount) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tsl/robin_map.h>
|
||||
@ -58,14 +59,17 @@ public:
|
||||
return it == m_mnt_pairs.end() ? nullptr : &*it;
|
||||
}
|
||||
|
||||
const MntPair* GetMount(const std::string& guest_path) {
|
||||
const std::optional<MntPair> GetMount(const std::string& guest_path) {
|
||||
std::scoped_lock lock{m_mutex};
|
||||
const auto it = std::ranges::find_if(m_mnt_pairs, [&](const auto& mount) {
|
||||
// When doing starts-with check, add a trailing slash to make sure we don't match
|
||||
// against only part of the mount path.
|
||||
return guest_path == mount.mount || guest_path.starts_with(mount.mount + "/");
|
||||
});
|
||||
return it == m_mnt_pairs.end() ? nullptr : &*it;
|
||||
if (it == m_mnt_pairs.end()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return *it;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@ -108,7 +108,7 @@ SaveInstance::SaveInstance(int slot_num, Libraries::UserService::OrbisUserServic
|
||||
mount_point = "/savedata" + std::to_string(slot_num);
|
||||
|
||||
this->exists = fs::exists(param_sfo_path);
|
||||
this->mounted = g_mnt->GetMount(mount_point) != nullptr;
|
||||
this->mounted = g_mnt->GetMount(mount_point) != std::nullopt;
|
||||
}
|
||||
|
||||
SaveInstance::~SaveInstance() {
|
||||
|
||||
@ -225,7 +225,7 @@ bool VideoOutDriver::SubmitFlip(VideoOutPort* port, s32 index, s64 flip_arg,
|
||||
bool is_eop /*= false*/) {
|
||||
{
|
||||
std::unique_lock lock{port->port_mutex};
|
||||
if (index != -1 && port->flip_status.flip_pending_num >= port->NumRegisteredBuffers()) {
|
||||
if (index != -1 && port->flip_status.flip_pending_num > 16) {
|
||||
LOG_ERROR(Lib_VideoOut, "Flip queue is full");
|
||||
return false;
|
||||
}
|
||||
@ -253,6 +253,7 @@ void VideoOutDriver::SubmitFlipInternal(VideoOutPort* port, s32 index, s64 flip_
|
||||
frame = presenter->PrepareBlankFrame(false);
|
||||
} else {
|
||||
const auto& buffer = port->buffer_slots[index];
|
||||
ASSERT_MSG(buffer.group_index >= 0, "Trying to flip an unregistered buffer!");
|
||||
const auto& group = port->groups[buffer.group_index];
|
||||
frame = presenter->PrepareFrame(group, buffer.address_left);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user