[gst-devel] osssink - patch to check open failure
Joshua N Pritikin
vishnu at pobox.com
Wed Jul 10 10:20:03 CEST 2002
The attached patch causes a warning if open("/dev/dsp",...) fails. Otherwise
it can fail silently.
--
Victory to the Divine Mother!! after all,
http://sahajayoga.org http://why-compete.org
-------------- next part --------------
--- gstosssink.c.orig Wed Jul 10 22:45:35 2002
+++ gstosssink.c Wed Jul 10 22:47:12 2002
@@ -795,10 +795,12 @@
/* re-open the sound device in blocking mode */
close(sink->fd);
sink->fd = open(sink->device, O_WRONLY);
+ if (sink->fd < 0) {
+ g_warning ("osssink: unable to open the sound device (errno=%d)\n", errno);
+ return FALSE;
+ }
- /* if we have it, set the default parameters and go have fun */
- if (sink->fd >= 0) {
- /* set card state */
+ /* we have it, set the default parameters and go have fun */
ioctl(sink->fd, SNDCTL_DSP_GETCAPS, &caps);
GST_INFO(GST_CAT_PLUGIN_INFO, "osssink: Capabilities %08x", caps);
@@ -839,9 +841,6 @@
GST_FLAG_SET (sink, GST_OSSSINK_OPEN);
return TRUE;
- }
-
- return FALSE;
}
static void
More information about the gstreamer-devel
mailing list