[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] 2 commits: module-stream-restore: log error writing volume/mute/device entry to database

Arun Raghavan gitlab at gitlab.freedesktop.org
Tue Oct 13 10:41:07 UTC 2020



Arun Raghavan pushed to branch master at PulseAudio / pulseaudio


Commits:
99b2d882 by Igor V. Kovalenko at 2020-10-13T10:35:44+00:00
module-stream-restore: log error writing volume/mute/device entry to database

- - - - -
05f56708 by Igor V. Kovalenko at 2020-10-13T10:35:44+00:00
module-stream-restore: check if dbus entry exists in dbus_entries map before creating it

If write_entry fails to store new entry in database, next time we can try creating new entry again.
With DBUS enabled this will create another dbus entry for same name leading to crash inserting duplicate into dbus_entries map.

Fix this by checking if dbus entry exists in dbus_entries map before creating it.

Fixes: #974

- - - - -


1 changed file:

- src/modules/module-stream-restore.c


Changes:

=====================================
src/modules/module-stream-restore.c
=====================================
@@ -1441,17 +1441,18 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
 
     pa_log_info("Storing volume/mute/device for stream %s.", name);
 
-    if (entry_write(u, name, entry, true))
+    if (entry_write(u, name, entry, true)) {
         trigger_save(u);
+    } else {
+        pa_log_error("Could not store volume/mute/device for stream %s.", name);
+    }
 
 #ifdef HAVE_DBUS
-    if (created_new_entry) {
+    if (!(de = pa_hashmap_get(u->dbus_entries, name))) {
         de = dbus_entry_new(u, name);
         pa_assert_se(pa_hashmap_put(u->dbus_entries, de->entry_name, de) == 0);
         send_new_entry_signal(de);
     } else {
-        pa_assert_se(de = pa_hashmap_get(u->dbus_entries, name));
-
         if (device_updated)
             send_device_updated_signal(de, entry);
         if (volume_updated)



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/e0ab9fa4a478a79fac5fa25a957daff4947d5133...05f567086b72f05f0995f5ea4e282a3ce8d0bb15

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/e0ab9fa4a478a79fac5fa25a957daff4947d5133...05f567086b72f05f0995f5ea4e282a3ce8d0bb15
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20201013/fb61e445/attachment-0001.htm>


More information about the pulseaudio-commits mailing list