mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-11-28 00:03:56 +00:00
Implement process and thread priority adjustments (#691)
This commit is contained in:
1 parent
997e8c6e5a
commit
cc688c7845
8 files changed
+128
-2
No files matched your search
@@ -89,6 +89,9 @@ void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
|
||||
auto packets = mail::man->queue<packet_t>(mail::audio_packets);
|
||||
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
||||
|
||||
// Encoding takes place on this thread
|
||||
platf::adjust_thread_priority(platf::thread_priority_e::high);
|
||||
|
||||
opus_t opus { opus_multistream_encoder_create(
|
||||
stream->sampleRate,
|
||||
stream->channelCount,
|
||||
@@ -173,6 +176,9 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
||||
}
|
||||
}
|
||||
|
||||
// Capture takes place on this thread
|
||||
platf::adjust_thread_priority(platf::thread_priority_e::critical);
|
||||
|
||||
auto samples = std::make_shared<sample_queue_t::element_type>(30);
|
||||
std::thread thread { encodeThread, samples, config, channel_data };
|
||||
|
||||
|
||||
Reference in new issue
Block a user