aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-11-17 00:43:24 +0100
committerdec05eba <dec05eba@protonmail.com>2024-11-17 00:43:24 +0100
commitbf577eec0b025f22195e0a9538e7350a9a7abbe0 (patch)
tree0007f07f23ba0bff3f6203196cbd6902ec2f1bec
parent0c59349d12692d10a5e88b933238a0359b8ee73b (diff)
Exclude duplicate app from --list-application-audio
-rw-r--r--TODO4
-rw-r--r--src/pipewire_audio.c15
2 files changed, 18 insertions, 1 deletions
diff --git a/TODO b/TODO
index 671eed1..e33fc34 100644
--- a/TODO
+++ b/TODO
@@ -190,4 +190,6 @@ Support transposing (rotating) with vaapi. This isn't supported on many devices
Cleanup pipewire_audio.c (proper error handling and memory cleanup of proxies).
-Hide application audio module-null-sink by using sink_properties=media.class="Audio/Sink/Internal". \ No newline at end of file
+Hide application audio module-null-sink by using sink_properties=media.class="Audio/Sink/Internal".
+
+Improve software encoding performance.
diff --git a/src/pipewire_audio.c b/src/pipewire_audio.c
index 122895a..49de50b 100644
--- a/src/pipewire_audio.c
+++ b/src/pipewire_audio.c
@@ -398,6 +398,21 @@ void gsr_pipewire_audio_for_each_app(gsr_pipewire_audio *self, gsr_pipewire_audi
if(node->type != GSR_PIPEWIRE_AUDIO_NODE_TYPE_STREAM_OUTPUT)
continue;
+ bool duplicate_app = false;
+ for(int j = i - 1; j >= 0; --j) {
+ const gsr_pipewire_audio_node *prev_node = &self->stream_nodes[j];
+ if(prev_node->type != GSR_PIPEWIRE_AUDIO_NODE_TYPE_STREAM_OUTPUT)
+ continue;
+
+ if(strcasecmp(node->name, prev_node->name) == 0) {
+ duplicate_app = true;
+ break;
+ }
+ }
+
+ if(duplicate_app)
+ continue;
+
if(!callback(node->name, userdata))
break;
}