Skip to content

Commit

Permalink
Fix port selection
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Feb 14, 2024
1 parent c683f78 commit 47d26c2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/PulseAudioManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,12 @@ public class Sound.PulseAudioManager : GLib.Object {
device.card_source_index = (int)source.index;
device.card_source_name = source.name;
debug ("\t\t\tdevice.card_source_name: %s", device.card_source_name);
if (source.active_port != null && device.port_name == source.active_port.name) {

if (source.active_port != null) {
device.card_source_port_name = source.active_port.name;
}

if (source.active_port != null && device.port_name == source.active_port.name) {
device.source_name = source.name;
debug ("\t\t\tdevice.source_name: %s", device.card_source_name);
device.source_index = (int)source.index;
Expand Down Expand Up @@ -535,8 +539,11 @@ public class Sound.PulseAudioManager : GLib.Object {
device.card_sink_name = sink.name;
debug ("\t\t\tdevice.card_sink_name: %s", device.card_sink_name);

if (sink.active_port != null && device.port_name == sink.active_port.name) {
if (sink.active_port != null) {
device.card_sink_port_name = sink.active_port.name;
}

if (sink.active_port != null && device.port_name == sink.active_port.name) {
device.sink_name = sink.name;
debug ("\t\t\tdevice.sink_name: %s", device.card_sink_name);
device.sink_index = (int)sink.index;
Expand Down

0 comments on commit 47d26c2

Please sign in to comment.