Commit 662c557c authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

ext/alsa/gstalsa.c: Try to get devic-name from device string first, and from...

ext/alsa/gstalsa.c: Try to get devic-name from device string first, and from handle only as fallback (seems to yield ...

Original commit message from CVS:
* 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).
parent 880da4d8
2007-02-09 Tim-Philipp Müller <tim at centricular dot net>
* 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 <tim at centricular dot net>
 
Based on patch by: Julien Puydt <julien.puydt at laposte net>
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment