Only close the device on probe if it succeeded in opening it.

Original commit message from CVS:
Only close the device on probe if it succeeded in opening it.
This commit is contained in:
Jan Schmidt 2004-03-13 06:47:25 +00:00
parent 7b7b337d12
commit 578c7544fc
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,6 @@
2004-03-13 Jan Schmidt <thaytan@mad.scientist.com>
* ext/alsa/gstalsa.c: (gst_alsa_class_probe_devices):
2004-03-13 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_free_list):

View file

@ -352,7 +352,8 @@ gst_alsa_class_probe_devices (GstAlsaClass *klass,
res == -EBUSY) {
klass->devices = g_list_append (klass->devices, dev);
snd_pcm_close (pcm);
if (res != -EBUSY)
snd_pcm_close (pcm);
} else {
g_free (dev);
}