diff --git a/ChangeLog b/ChangeLog index 47414a3c04..c6a7dc711f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-09 Tim-Philipp Müller + + * ext/alsa/gstalsa.c: (gst_alsa_find_device_name): + Try to get devic-name from device string first, and from handle only + as fallback (seems to yield better results and is more robust + against buggy probing code on the application side). + 2007-02-08 Tim-Philipp Müller Based on patch by: Julien Puydt diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 7653475fea..5d7f1ef831 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -451,17 +451,7 @@ gst_alsa_find_device_name (GstObject * obj, const gchar * device, { gchar *ret = NULL; - if (handle != NULL) { - snd_pcm_info_t *info; - - GST_LOG_OBJECT (obj, "Trying to get device name from open handle"); - snd_pcm_info_malloc (&info); - snd_pcm_info (handle, info); - ret = g_strdup (snd_pcm_info_get_name (info)); - snd_pcm_info_free (info); - } - - if (ret == NULL && device != NULL) { + if (device != NULL) { gchar *dev, *comma; gint devnum; @@ -477,6 +467,16 @@ gst_alsa_find_device_name (GstObject * obj, const gchar * device, g_free (dev); } + if (ret == NULL && handle != NULL) { + snd_pcm_info_t *info; + + GST_LOG_OBJECT (obj, "Trying to get device name from open handle"); + snd_pcm_info_malloc (&info); + snd_pcm_info (handle, info); + ret = g_strdup (snd_pcm_info_get_name (info)); + snd_pcm_info_free (info); + } + GST_LOG_OBJECT (obj, "Device name for device '%s': %s", GST_STR_NULL (device), GST_STR_NULL (ret));