mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-07 12:39:53 +00:00
Search for active sink, rather than hardware sink
This commit is contained in:
parent
988bf33b40
commit
5495c8367a
@ -1 +1 @@
|
||||
Subproject commit 5d09d43b0866d9fa30cc1741f9e10de5420deaad
|
||||
Subproject commit a13eeddacfdb4325bd7d140d635a8cb87e61a61d
|
@ -87,11 +87,11 @@ void encodeThread(packet_queue_t packets, sample_queue_t samples, config_t confi
|
||||
|
||||
auto frame_size = config.packetDuration * stream->sampleRate / 1000;
|
||||
while(auto sample = samples->pop()) {
|
||||
packet_t packet { 16 * 1024 }; // 16KB
|
||||
packet_t packet { 1024 }; // 1KB
|
||||
|
||||
int bytes = opus_multistream_encode(opus.get(), sample->data(), frame_size, std::begin(packet), packet.size());
|
||||
if(bytes < 0) {
|
||||
BOOST_LOG(error) << opus_strerror(bytes);
|
||||
BOOST_LOG(error) << "Couldn't encode audio: "sv << opus_strerror(bytes);
|
||||
packets->stop();
|
||||
|
||||
return;
|
||||
|
@ -299,9 +299,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if(sink_info->flags & PA_SINK_HARDWARE &&
|
||||
sink_info->channel_map.channels > channels) {
|
||||
|
||||
if(sink_info->active_port != nullptr) {
|
||||
sink.host = sink_info->name;
|
||||
channels = sink_info->channel_map.channels;
|
||||
}
|
||||
@ -339,7 +337,7 @@ public:
|
||||
}
|
||||
|
||||
if(!channels) {
|
||||
BOOST_LOG(warning) << "Couldn't find hardware sink"sv;
|
||||
BOOST_LOG(warning) << "Couldn't find an active sink"sv;
|
||||
}
|
||||
|
||||
if(index.stereo == PA_INVALID_INDEX) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user