Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c7fd58
)
extras/audio: Preventing a crash on sound with no data
author
Jerome St-Louis
<jerome@ecere.com>
Sat, 19 Apr 2014 13:31:51 +0000
(09:31 -0400)
committer
Jerome St-Louis
<jerome@ecere.com>
Sat, 19 Apr 2014 13:31:51 +0000
(09:31 -0400)
extras/audio/mixer.ec
patch
|
blob
|
history
diff --git
a/extras/audio/mixer.ec
b/extras/audio/mixer.ec
index
664ab24
..
2fe229c
100644
(file)
--- a/
extras/audio/mixer.ec
+++ b/
extras/audio/mixer.ec
@@
-276,12
+276,16
@@
public:
Voice Play(Sound sound, double volume, double balance, double pitch)
{
- Voice voice { sound, volume, balance, pitch };
- mutex.Wait();
- voices.Add(voice);
- incref voice;
- mutex.Release();
- return voice;
+ if(sound && sound.data)
+ {
+ Voice voice { sound, volume, balance, pitch };
+ mutex.Wait();
+ voices.Add(voice);
+ incref voice;
+ mutex.Release();
+ return voice;
+ }
+ return null;
}
void Wait()