summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/oss/gstosssink.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c
index c2feb7c8..94561540 100644
--- a/sys/oss/gstosssink.c
+++ b/sys/oss/gstosssink.c
@@ -813,11 +813,12 @@ gst_osssink_open_audio (GstOssSink *sink)
sink->fd = open (sink->device, O_WRONLY | O_NONBLOCK);
if (errno == EBUSY) {
g_warning ("osssink: unable to open the sound device (in use ?)\n");
- return FALSE;
}
+ if (sink->fd >= 0)
+ close (sink->fd);
+
/* re-open the sound device in blocking mode */
- close (sink->fd);
sink->fd = open (sink->device, O_WRONLY);
if (sink->fd < 0) {