Explorar el Código

Fix broken wav decoding on partial decodes, seemed to mostly/only affect 8-bit wav

Bart van Strien hace 10 años
padre
commit
2a33af3920
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/modules/sound/lullaby/WaveDecoder.cpp

+ 2 - 2
src/modules/sound/lullaby/WaveDecoder.cpp

@@ -126,8 +126,8 @@ int WaveDecoder::decode()
 
 	while (size < (size_t) bufferSize)
 	{
-		size_t bytes = bufferSize;
-		int wuff_status = wuff_read(handle, (wuff_uint8 *) buffer, &bytes);
+		size_t bytes = bufferSize-size;
+		int wuff_status = wuff_read(handle, (wuff_uint8 *) buffer+size, &bytes);
 
 		if (wuff_status < 0)
 			return 0;