mirror of https://github.com/RPCS3/rpcs3.git
Compare commits
16 Commits
0ef035404c
...
866f91f0fc
Author | SHA1 | Date |
---|---|---|
hoholee12 | 866f91f0fc | |
capriots | 66eae05e75 | |
hoholee12 | 4695e9c1f5 | |
hoholee12 | 328d73c1a9 | |
hoholee12 | 0ce786cd78 | |
hoholee12 | ca381b07e9 | |
hoholee12 | 4300857108 | |
Elad Ashkenazi | 37957530f9 | |
hoholee12 | b9257cf0a3 | |
hoholee12 | 445bae198b | |
hoholee12 | db4c960a3b | |
Elad Ashkenazi | 45023d298b | |
hoholee12 | 3d1f527652 | |
hoholee12 | cf785e2ad6 | |
hoholee12 | e5c1fea20a | |
hoholee12 | 8163aaf7de |
|
@ -53,6 +53,8 @@ DYNAMIC_IMPORT_RENAME("Kernel32.dll", SetThreadDescriptionImport, "SetThreadDesc
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <sys/timerfd.h>
|
#include <sys/timerfd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#define gettid() syscall(SYS_gettid)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
|
@ -3090,6 +3092,24 @@ void thread_ctrl::set_native_priority(int priority)
|
||||||
{
|
{
|
||||||
sig_log.error("SetThreadPriority() failed: %s", fmt::win_error{GetLastError(), nullptr});
|
sig_log.error("SetThreadPriority() failed: %s", fmt::win_error{GetLastError(), nullptr});
|
||||||
}
|
}
|
||||||
|
#elif defined(__linux__)
|
||||||
|
// available niceness for root: -20~19
|
||||||
|
id_t threadpid = gettid();
|
||||||
|
uid_t euid = geteuid();
|
||||||
|
|
||||||
|
if (euid == 0)
|
||||||
|
{
|
||||||
|
int linuxprio = 0;
|
||||||
|
if (priority > 0)
|
||||||
|
linuxprio = -6;
|
||||||
|
else if (priority < 0)
|
||||||
|
linuxprio = 6;
|
||||||
|
|
||||||
|
if (int err = setpriority(PRIO_PROCESS, threadpid, linuxprio))
|
||||||
|
{
|
||||||
|
sig_log.error("setpriority(%d, %d) failed: %d", threadpid, linuxprio, err);
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
int policy;
|
int policy;
|
||||||
struct sched_param param;
|
struct sched_param param;
|
||||||
|
|
|
@ -121,6 +121,7 @@ void AtracXdecDecoder::alloc_avcodec()
|
||||||
|
|
||||||
// Allows FFmpeg to output directly into guest memory
|
// Allows FFmpeg to output directly into guest memory
|
||||||
ctx->opaque = this;
|
ctx->opaque = this;
|
||||||
|
ctx->thread_type = FF_THREAD_SLICE; // Silences a warning by FFmpeg about requesting frame threading with a custom get_buffer2(). Default is FF_THREAD_FRAME & FF_THREAD_SLICE
|
||||||
ctx->get_buffer2 = [](AVCodecContext* s, AVFrame* frame, int /*flags*/) -> int
|
ctx->get_buffer2 = [](AVCodecContext* s, AVFrame* frame, int /*flags*/) -> int
|
||||||
{
|
{
|
||||||
for (s32 i = 0; i < frame->ch_layout.nb_channels; i++)
|
for (s32 i = 0; i < frame->ch_layout.nb_channels; i++)
|
||||||
|
|
Loading…
Reference in New Issue