From: Stefan Kost Date: Thu, 26 Feb 2009 14:47:39 +0000 (+0200) Subject: alsa: cleanup name lookup. X-Git-Tag: RELEASE-0.10.23~227 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c074e8436026593997925668fb9d786e20720d85;p=platform%2Fupstream%2Fgst-plugins-base.git alsa: cleanup name lookup. We can break, once we have a name to make sure, we won't read it ever twice. --- diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 9fb16a4..17afe1f 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; + } } }