Ver código fonte

bugfix WAV channel leak

ncannasse 11 anos atrás
pai
commit
7f72f2d974
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      hxd/res/Sound.hx

+ 3 - 0
hxd/res/Sound.hx

@@ -123,6 +123,9 @@ class Sound extends Resource {
 	public function playAt( startPosition : Float ) {
 		#if flash
 		if( snd != null ) {
+			// can't mix two wavs
+			if( wavHeader != null && channel != null )
+				return;
 			bytesPosition = 0;
 			channel = snd.play(startPosition,loop?0x7FFFFFFF:0);
 			volume = volume;