From: Wim T. <wt...@us...> - 2003-01-27 20:37:04
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: wtay Date: Mon Jan 27 2003 12:37:02 PST Log message: Removed bogus patch 1.4 to make osssrc work again. Modified files: sys/oss : gstosscommon.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/sys/oss/gstosscommon.c.diff?r1=1.4&r2=1.5 ====Begin Diffs==== Index: gstosscommon.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/sys/oss/gstosscommon.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gstosscommon.c 12 Jan 2003 11:43:46 -0000 1.4 +++ gstosscommon.c 27 Jan 2003 20:36:46 -0000 1.5 @@ -281,41 +281,25 @@ GST_INFO (GST_CAT_PLUGIN_INFO, "common: attempting to open sound device"); /* first try to open the sound card */ - /* FIXME: This code is dubious, why do we need to open and close this ? - * For linux at least this causes the second open to never return - * if the device was already in use .. */ -#ifndef __linux__ if (mode == GST_OSSCOMMON_WRITE) { -#endif + /* open non blocking first so that it returns immediatly with an error + * when we cannot get to the device */ common->fd = open (common->device, O_WRONLY | O_NONBLOCK); -#ifdef __linux__ - if (common->fd >= 0) { - /* remove the non-blocking flag */ - if(fcntl (common->fd, F_SETFL, 0) < 0) { - *error = g_strdup_printf ("osscommon: Can't make filedescriptor blocking for %s", - common->device); - return FALSE; - } - } -#else - if (errno == EBUSY) { - g_warning ("osscommon: unable to open the sound device (in use ?)\n"); - } - if (common->fd >= 0) + if (common->fd >= 0) { close (common->fd); - - /* re-open the sound device in blocking mode */ - common->fd = open (common->device, O_WRONLY); + + /* re-open the sound device in blocking mode */ + common->fd = open (common->device, O_WRONLY); + } } else { common->fd = open (common->device, O_RDONLY); } -#endif if (common->fd < 0) { switch (errno) { - case EBUSY: + case EBUSY: *error = g_strdup_printf ("osscommon: Unable to open %s (in use ?)", common->device); break; |