Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
vitaquake3
Commits
6eeea01d
Commit
6eeea01d
authored
Jul 21, 2019
by
Rinnegatamante
Browse files
Fixed random crashes when joining online servers.
parent
09f9d048
Changes
2
Show whitespace changes
Inline
Side-by-side
code/client/snd_mem.c
View file @
6eeea01d
...
...
@@ -83,13 +83,13 @@ void SND_setup(void) {
scs
=
(
cv
->
integer
*
1536
);
buffer
=
malloc
(
scs
*
sizeof
(
sndBuffer
)
);
if
(
buffer
==
NULL
)
buffer
=
malloc
(
scs
*
sizeof
(
sndBuffer
)
);
// allocate the stack based hunk allocator
sfxScratchBuffer
=
malloc
(
SND_CHUNK_SIZE
*
sizeof
(
short
)
*
4
);
//Hunk_Alloc(SND_CHUNK_SIZE * sizeof(short) * 4);
if
(
sfxScratchBuffer
==
NULL
)
sfxScratchBuffer
=
malloc
(
SND_CHUNK_SIZE
*
sizeof
(
short
)
*
4
);
//Hunk_Alloc(SND_CHUNK_SIZE * sizeof(short) * 4);
sfxScratchPointer
=
NULL
;
inUse
=
scs
*
sizeof
(
sndBuffer
);
p
=
buffer
;
;
p
=
buffer
;
q
=
p
+
scs
;
while
(
--
q
>
p
)
*
(
sndBuffer
**
)
q
=
q
-
1
;
...
...
@@ -102,8 +102,8 @@ void SND_setup(void) {
void
SND_shutdown
(
void
)
{
free
(
sfxScratchBuffer
);
free
(
buffer
);
//->
free(sfxScratchBuffer);
//->
free(buffer);
}
/*
...
...
code/psp2/psp2_snd.c
View file @
6eeea01d
...
...
@@ -57,6 +57,8 @@ static int audio_thread(int args, void *argp)
return
0
;
}
uint8_t
psp2_inited
=
0
;
/*
===============
SNDDMA_Init
...
...
@@ -64,6 +66,8 @@ SNDDMA_Init
*/
qboolean
SNDDMA_Init
(
void
)
{
if
(
psp2_inited
)
return
qtrue
;
psp2_inited
=
1
;
Com_Printf
(
"Initializing audio device.
\n
"
);
dma
.
samplebits
=
16
;
dma
.
speed
=
SAMPLE_RATE
;
...
...
@@ -115,8 +119,8 @@ void SNDDMA_Shutdown(void)
{
Com_Printf
(
"Closing audio device...
\n
"
);
if
(
snd_inited
){
stop_audio
=
qtrue
;
chn
=
-
1
;
//->
stop_audio = qtrue;
//->
chn = -1;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment