[Kwintv] PATCH: working devfs support in ossmixer plugin in qtvision
Neil Macvicar
kwintv@mail.kde.org
Mon, 2 Dec 2002 11:25:21 +0000
--Boundary-00=_hM069BVeiBde4SX
Content-Type: Text/Plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Description: clearsigned data
Content-Disposition: inline
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
Here's a patch to fix the broken devFS support in the OSS mixer module. It's
against the latest CVS.
Regards,
- --Neil.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)
iD8DBQE960Mqg9NhRdK7zrIRAq9uAKDkYJ8dFNqD8/c3Xnk32Mr1aJJgdgCg2Tey
F8Yfw8eByrO+6ao8BvpZBYc=
=LkVZ
-----END PGP SIGNATURE-----
--Boundary-00=_hM069BVeiBde4SX
Content-Type: text/x-diff;
charset="us-ascii";
name="qtvision-ossmixer-devfs.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="qtvision-ossmixer-devfs.patch"
--- kdenonbeta/kwintv3/qtvision/plugins/mixer/oss/qtvision_oss.cpp Mon Dec 2 10:44:56 2002
+++ qtvision_oss.cpp Mon Dec 2 11:18:53 2002
@@ -39,8 +39,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
-#include <sys/stat.h>
-
#if defined(__linux__)
#include <sys/soundcard.h>
@@ -112,13 +110,13 @@
_dev = "";
_devnum = 0;
QString dev("/dev/mixer%1");
- struct stat sb;
- // Devfs support ?? -- broken
- if (!stat("/dev/sound", &sb)) {
- if (S_ISDIR(sb.st_mode)) {
- dev = "/dev/sound/mixer%1";
- }
+ // Working devfs support for OSS mixers.
+ if (!access("/dev/sound/mixer", R_OK|W_OK)) {
+ // we are using devfs, so change the device divining string
+ dev = "/dev/sound/mixer%1";
+
+ _devlist << "/dev/sound/mixer";
}
if (!access("/dev/mixer", R_OK|W_OK)) {
--Boundary-00=_hM069BVeiBde4SX--