summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/cli-text.c2
-rw-r--r--src/pulsecore/protocol-native.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index eecf68ff..a1a2e564 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.c
@@ -109,7 +109,7 @@ char *pa_sink_list_to_string(pa_core *c) {
sink->driver,
pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, PA_MIXER_HARDWARE)),
(double) pa_sink_get_latency(sink),
- sink->monitor_source->index,
+ sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
pa_sample_spec_snprint(ss, sizeof(ss), &sink->sample_spec),
pa_channel_map_snprint(cm, sizeof(cm), &sink->channel_map));
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index d5a4cf45..98212922 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1276,8 +1276,8 @@ static void sink_fill_tagstruct(pa_tagstruct *t, pa_sink *sink) {
PA_TAG_U32, sink->owner ? sink->owner->index : PA_INVALID_INDEX,
PA_TAG_CVOLUME, pa_sink_get_volume(sink, PA_MIXER_HARDWARE),
PA_TAG_BOOLEAN, pa_sink_get_mute(sink, PA_MIXER_HARDWARE),
- PA_TAG_U32, sink->monitor_source->index,
- PA_TAG_STRING, sink->monitor_source->name,
+ PA_TAG_U32, sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
+ PA_TAG_STRING, sink->monitor_source ? sink->monitor_source->name : NULL,
PA_TAG_USEC, pa_sink_get_latency(sink),
PA_TAG_STRING, sink->driver,
PA_TAG_U32,