diff options
author | Chris Robinson <[email protected]> | 2021-08-26 23:26:42 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-09-01 20:06:24 -0700 |
commit | 325523b06a3b34d1b759b582a2db33a8013d7517 (patch) | |
tree | 3a40ec895fd0d18ebfda36bb0a999fd965acb6f1 /alc/backends/pipewire.cpp | |
parent | a4b0a3d7b3ec271243cfda4780e567e49f2b37b7 (diff) |
Fix when a PipeWire metadata property is being cleared
Diffstat (limited to 'alc/backends/pipewire.cpp')
-rw-r--r-- | alc/backends/pipewire.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp index 096997c4..1847e866 100644 --- a/alc/backends/pipewire.cpp +++ b/alc/backends/pipewire.cpp @@ -717,6 +717,13 @@ int MetadataProxy::propertyCallback(uint32_t id, const char *key, const char *ty return 0; } + if(!type) + { + TRACE("Default %s device cleared\n", isCapture ? "capture" : "playback"); + if(!isCapture) DefaultSinkDev.clear(); + else DefaultSourceDev.clear(); + return 0; + } if(std::strcmp(type, "Spa:String:JSON") != 0) { ERR("Unexpected %s property type: %s\n", key, type); @@ -859,7 +866,7 @@ void EventManager::addCallback(uint32_t id, uint32_t, const char *type, uint32_t } else if(std::strcmp(type, PW_TYPE_INTERFACE_Metadata) == 0) { - const char *data_class{spa_dict_lookup(props, "metadata.name")}; + const char *data_class{spa_dict_lookup(props, PW_KEY_METADATA_NAME)}; if(!data_class) return; if(std::strcmp(data_class, "default") != 0) |