[pulseaudio-commits] src/modules

David Henningsson diwic at kemper.freedesktop.org
Tue Oct 28 02:35:48 PDT 2014


 src/modules/module-card-restore.c   |    6 ++++--
 src/modules/module-device-restore.c |    8 +++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit cc7c626e69dde909443831398c28c2ee05f8279c
Author: David Henningsson <david.henningsson at canonical.com>
Date:   Mon Oct 20 16:19:36 2014 +0200

    module-card/device-restore: Do not legacy load an empty entry
    
    There is no use in trying to load data in legacy format, if we
    already know that there is no data at all.
    Also clarify in the debug message whether there is invalid data
    or no data at all.
    
    Signed-off-by: David Henningsson <david.henningsson at canonical.com>

diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 5b02602..681acca 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -269,8 +269,10 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
 
     pa_zero(data);
 
-    if (!pa_database_get(u->database, &key, &data))
-        goto fail;
+    if (!pa_database_get(u->database, &key, &data)) {
+        pa_log_debug("Database contains no data for key: %s", name);
+        return NULL;
+    }
 
     t = pa_tagstruct_new(data.data, data.size);
     e = entry_new();
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index b7f172f..cb42207 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -233,8 +233,10 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
 
     pa_zero(data);
 
-    if (!pa_database_get(u->database, &key, &data))
-        goto fail;
+    if (!pa_database_get(u->database, &key, &data)) {
+        pa_log_debug("Database contains no data for key: %s", name);
+        return NULL;
+    }
 
     t = pa_tagstruct_new(data.data, data.size);
     e = entry_new();
@@ -477,7 +479,7 @@ fail:
     }
 #endif
 
-    pa_log_debug("Database contains invalid data for key: %s", name);
+    pa_log_debug("Database contains no (or invalid) data for key: %s", name);
 
     pa_xfree(name);
 



More information about the pulseaudio-commits mailing list