Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions libcvc/gvc-mixer-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ gvc_mixer_control_lookup_device_from_stream (GvcMixerControl *control,
}

port = gvc_mixer_stream_get_port (stream);
if (g_strcmp0 (gvc_mixer_ui_device_get_port (device), port->port) == 0) {
if (port != NULL &&
g_strcmp0 (gvc_mixer_ui_device_get_port (device), port->port) == 0) {
g_debug ("lookup-device-from-stream found device: device description '%s', device port = '%s', device stream id %i AND stream port = '%s' stream id '%u' and stream description '%s'",
gvc_mixer_ui_device_get_description (device),
gvc_mixer_ui_device_get_port (device),
Expand Down Expand Up @@ -621,7 +622,7 @@ gvc_mixer_control_change_output (GvcMixerControl *control,
active_port = gvc_mixer_stream_get_port (stream);
output_port = gvc_mixer_ui_device_get_port (output);
/* First ensure the correct port is active on the sink */
if (g_strcmp0 (active_port->port, output_port) != 0) {
if (active_port == NULL || g_strcmp0 (active_port->port, output_port) != 0) {
g_debug ("Port change, switch to = %s", output_port);
if (gvc_mixer_stream_change_port (stream, output_port) == FALSE) {
g_warning ("Could not change port !");
Expand Down Expand Up @@ -691,7 +692,7 @@ gvc_mixer_control_change_input (GvcMixerControl *control,
active_port = gvc_mixer_stream_get_port (stream);
input_port = gvc_mixer_ui_device_get_port (input);
/* First ensure the correct port is active on the sink */
if (g_strcmp0 (active_port->port, input_port) != 0) {
if (active_port == NULL || g_strcmp0 (active_port->port, input_port) != 0) {
g_debug ("Port change, switch to = %s", input_port);
if (gvc_mixer_stream_change_port (stream, input_port) == FALSE) {
g_warning ("Could not change port!");
Expand Down