diff options
| author | 2010-05-22 05:10:49 +0000 | |
|---|---|---|
| committer | 2010-05-22 05:10:49 +0000 | |
| commit | 56cf0e41df66de65769e8965550d783112d91e3a (patch) | |
| tree | 7577a802f3d1e9946edd28c709f8059e715f13a0 /src/modules/snd/libkvisnd.cpp | |
| parent | Fixed segfault in kvs class list (diff) | |
| download | KVIrc-56cf0e41df66de65769e8965550d783112d91e3a.tar.gz KVIrc-56cf0e41df66de65769e8965550d783112d91e3a.tar.bz2 KVIrc-56cf0e41df66de65769e8965550d783112d91e3a.zip | |
avoid opening the sound device in exclusive mode and also avoid opening the sound file in write mode
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4353 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/snd/libkvisnd.cpp')
| -rw-r--r-- | src/modules/snd/libkvisnd.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index 05385c3a0..d7f53ecdd 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -372,17 +372,19 @@ void KviSoundThread::run() channelCount = afGetVirtualChannels(file, AF_DEFAULT_TRACK); buffer = kvi_malloc(int(BUFFER_FRAMES * frameSize)); - int audiofd_c = open("/dev/dsp", O_WRONLY | O_EXCL | O_NDELAY); + int audiofd_c = open("/dev/dsp", O_WRONLY | /*O_EXCL |*/ O_NDELAY); + QFile audiofd; - audiofd.open(audiofd_c,QIODevice::WriteOnly); if(audiofd_c < 0) { - debug("Could not open audio devive /dev/dsp! [OSS]"); - debug("(the device is probably busy)"); + debug("Could not open audio device /dev/dsp! [OSS+AUDIOFILE]"); + debug("(the device is probably busy , errno = %d)",errno); goto exit_thread; } + audiofd.open(audiofd_c,QIODevice::WriteOnly); // ???? what the heck is this for ? + if (sampleWidth == 8) format = AFMT_U8; else if (sampleWidth == 16)format = AFMT_S16_NE; @@ -441,7 +443,7 @@ void KviSoundThread::run() int iDataLen = 0; int iSize = 0; - if(!f.open(QIODevice::WriteOnly)) + if(!f.open(QIODevice::ReadOnly)) { debug("Could not open sound file %s! [OSS]",m_szFileName.toUtf8().data()); return; @@ -463,7 +465,7 @@ void KviSoundThread::run() iSize -= 24; - fd = open("/dev/audio", O_WRONLY | O_EXCL | O_NDELAY); + fd = open("/dev/audio", O_WRONLY | /*O_EXCL |*/ O_NDELAY); if(fd < 0) { debug("Could not open device file /dev/audio!"); |
