From c074e8436026593997925668fb9d786e20720d85 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 26 Feb 2009 16:47:39 +0200 Subject: [PATCH] alsa: cleanup name lookup. We can break, once we have a name to make sure, we won't read it ever twice. --- ext/alsa/gstalsa.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 9fb16a498e..17afe1f17c 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -493,9 +493,13 @@ gst_alsa_find_device_name_no_handle (GstObject * obj, const gchar * devcard, break; } - ret = g_strdup (snd_pcm_info_get_name (pcminfo)); + ret = (gchar *) snd_pcm_info_get_name (pcminfo); snd_pcm_info_free (pcminfo); - GST_LOG_OBJECT (obj, "name from pcminfo: %s", GST_STR_NULL (ret)); + if (ret) { + ret = g_strdup (ret); + GST_LOG_OBJECT (obj, "name from pcminfo: %s", ret); + break; + } } }