mixer: find a better name

if pa does not provide the name via the proplist we can just use the
information from name if the name exists
This commit is contained in:
Marcel Hollerbach 2017-08-14 17:34:03 +02:00 committed by Mike Blumenkrantz
parent b1a64b290f
commit e32fab8b8e
1 changed files with 11 additions and 3 deletions

View File

@ -333,9 +333,17 @@ _sink_input_cb(pa_context *c EINA_UNUSED, const pa_sink_input_info *info,
Eina_Strbuf *input_name;
input_name = eina_strbuf_new();
eina_strbuf_append(input_name, pa_proplist_gets(info->proplist, PA_PROP_APPLICATION_NAME));
eina_strbuf_append(input_name, ":");
eina_strbuf_append(input_name, info->name);
const char *application = pa_proplist_gets(info->proplist, PA_PROP_APPLICATION_NAME);
if (application)
{
eina_strbuf_append(input_name, application);
eina_strbuf_append(input_name, ":");
eina_strbuf_append(input_name, info->name);
}
else if (info->name)
{
eina_strbuf_append(input_name, info->name);
}
input->base.name = eina_stringshare_add(eina_strbuf_string_get(input_name));
eina_strbuf_free(input_name);
input->base.volume = _pa_cvolume_convert(&info->volume);