mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
fixed music playback crash in CPMA credits with s_musicvolume > 0
This commit is contained in:
parent
7923a0a94e
commit
9b114e7886
1 changed files with 5 additions and 0 deletions
|
@ -1037,6 +1037,11 @@ static void S_UpdateBackgroundTrack()
|
||||||
// decide how much data needs to be read from the file
|
// decide how much data needs to be read from the file
|
||||||
fileSamples = bufferSamples * s_backgroundStream->info.rate / dma.speed;
|
fileSamples = bufferSamples * s_backgroundStream->info.rate / dma.speed;
|
||||||
|
|
||||||
|
// fileSamples can become 0 when dma.speed > s_backgroundStream->info.rate
|
||||||
|
if ( fileSamples <= 0 ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// our max buffer size
|
// our max buffer size
|
||||||
fileBytes = fileSamples * (s_backgroundStream->info.width * s_backgroundStream->info.channels);
|
fileBytes = fileSamples * (s_backgroundStream->info.width * s_backgroundStream->info.channels);
|
||||||
if ( fileBytes > sizeof(raw) ) {
|
if ( fileBytes > sizeof(raw) ) {
|
||||||
|
|
Loading…
Reference in a new issue