Skip to contentSkip to conversation

Problems in snd_device_name_hint

PATCH John Lindgren 1 participant 1 message Oct 24, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

I haven't frequented the alsa-devel list in the past, but Debian's maintainer apparently prefers that I go directly to the ALSA developers. While developing a new ALSA output plugin for Audacious audio player, I have run into several problems in snd_device_name_hint. I've already described the problems in the Debian bug tracker and made up some patches, which I would like someone to review. Here are the links:

        http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549531
        http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552240

I'm also attaching the patches here.

Peace,
John Lindgren

dlmisc.c renamed from dlmisc.0.c +7 -3
@@ -54,9 +54,13 @@
 #else
 #ifdef HAVE_LIBDL
 	if (name == NULL) {
-		Dl_info dlinfo;
-		if (dladdr(snd_dlopen, &dlinfo) > 0)
-			name = dlinfo.dli_fname;
+		static const char * self = NULL;
+		if (self == NULL) {
+			Dl_info dlinfo;
+			if (dladdr(snd_dlopen, &dlinfo) > 0)
+				self = dlinfo.dli_fname;
+		}
+		name = self;
 	}
 #endif
 #endif
conf.c renamed from conf.0.c +0 -2
@@ -1132,7 +1132,6 @@
 				free(id);
 				continue;
 			}
-			snd_config_delete(n);
 		}
 		if (mode == MERGE) {
 			SNDERR("%s does not exists", id);
@@ -1156,7 +1155,6 @@
 				skip = 1;
 				n = NULL;
 			} else if (mode == OVERRIDE) {
-				snd_config_delete(n);
 				n = NULL;
 			}
 		} else {
namehint.c renamed from namehint.0.c +0 -3
@@ -328,7 +328,6 @@
 	if (snd_config_search(cfg1, "slave", &cfg) >= 0 &&
 	    snd_config_search(cfg, base, &cfg1) >= 0)
 	    	goto __hint;
-	snd_config_delete(res);
 	res = NULL;
 	if (strchr(buf, ':') != NULL)
 		goto __ok;
@@ -379,8 +378,6 @@
 	      	err = hint_list_add(list, buf, buf1);
 	}
       __skip_add:
-      	if (res)
-	      	snd_config_delete(res);
 	if (buf1)
 		free(buf1);
       	free(buf);

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel