pulse: handle device_name of NULL as error

This commit is contained in:
Wim Taymans 2020-08-04 18:15:19 +02:00
parent 979fec288e
commit 653465a1b1

View file

@ -751,11 +751,9 @@ const char *pa_stream_get_device_name(PA_CONST pa_stream *s)
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE); PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE); PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
// PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->device_name, PA_ERR_BADSTATE); PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->device_name, PA_ERR_BADSTATE);
if (s->device_name == NULL)
return "unnamed";
pw_log_trace("stream %p: %s %d", s, s->device_name, s->device_index);
return s->device_name; return s->device_name;
} }