diff options
| author | 2008-09-18 22:23:20 +0000 | |
|---|---|---|
| committer | 2008-09-18 22:23:20 +0000 | |
| commit | 5385858ec91eb4cd42f86ced4da35bfacc83a379 (patch) | |
| tree | 4631a5bdb7ca5df09a82993c7737278d3ae3375e /src/modules/snd/libkvisnd.cpp | |
| parent | Correctly encode my surname (was broken by #2483) (diff) | |
| download | KVIrc-5385858ec91eb4cd42f86ced4da35bfacc83a379.tar.gz KVIrc-5385858ec91eb4cd42f86ced4da35bfacc83a379.tar.bz2 KVIrc-5385858ec91eb4cd42f86ced4da35bfacc83a379.zip | |
Fix continue behaviour in for and foreach
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2490 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/snd/libkvisnd.cpp')
| -rw-r--r-- | src/modules/snd/libkvisnd.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index 0bd6d8e13..ee535f8c2 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -391,8 +391,26 @@ void KviSoundThread::run() float frameSize; void * buffer; - file = afOpenFile(m_szFileName.toUtf8().data(),"r",NULL); + file = afOpenFile(m_szFileName.utf8().data(),"r",NULL); + if(!file) + { + debug("libaudiofile could not open the file %s",m_szFileName.utf8().data()); + debug("giving up playing sound..."); + return; // screwed up + } + + sampleFormat = -1; + afGetVirtualSampleFormat(file, AF_DEFAULT_TRACK, &sampleFormat, &sampleWidth); + + if(sampleFormat == -1) + { + debug("libaudiofile couldn't find the sample format for file %s",m_szFileName.utf8().data()); + debug("giving up playing sound..."); + afCloseFile(file); + return; // screwed up + } + frameSize = afGetVirtualFrameSize(file, AF_DEFAULT_TRACK, 1); channelCount = afGetVirtualChannels(file, AF_DEFAULT_TRACK); buffer = kvi_malloc(int(BUFFER_FRAMES * frameSize)); |
