mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 22:40:50 +00:00
- Implement AL_UnqueueRawSamples() and use it to stop the Vorbis playback
imediatly - Increase Vorbis buffers to 64. 24 were to few
This commit is contained in:
parent
2b6389a471
commit
c62e5ac85b
2 changed files with 18 additions and 5 deletions
|
@ -585,4 +585,9 @@ void AL_RawSamples( int samples, int rate, int width, int channels, byte *data,
|
|||
*/
|
||||
}
|
||||
|
||||
void AL_UnqueueRawSamples()
|
||||
{
|
||||
S_AL_StreamDie();
|
||||
}
|
||||
|
||||
#endif // USE_OPENAL
|
||||
|
|
|
@ -39,6 +39,10 @@
|
|||
#include "header/local.h"
|
||||
#include "header/vorbis.h"
|
||||
|
||||
#ifdef USE_OPENAL
|
||||
void AL_UnqueueRawSamples();
|
||||
#endif
|
||||
|
||||
qboolean ogg_first_init = true; /* First initialization flag. */
|
||||
qboolean ogg_started = false; /* Initialization flag. */
|
||||
int ogg_bigendian = 0;
|
||||
|
@ -583,6 +587,10 @@ OGG_Stop ( void )
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef USE_OPENAL
|
||||
AL_UnqueueRawSamples();
|
||||
#endif
|
||||
|
||||
ov_clear( &ovFile );
|
||||
ogg_status = STOP;
|
||||
ogg_info = NULL;
|
||||
|
@ -617,16 +625,16 @@ OGG_Stream ( void )
|
|||
We take the number of active buffers
|
||||
at startup (at this point most of the
|
||||
samples should be precached and loaded
|
||||
into buffers) and add 24. Empircal
|
||||
into buffers) and add 64. Empircal
|
||||
testing showed, that at most times
|
||||
at least 12 buffers remain available
|
||||
for OGG/Vorbis, enough for about 0.5
|
||||
at least 52 buffers remain available
|
||||
for OGG/Vorbis, enough for about 3
|
||||
seconds playback. The music won't
|
||||
stutter as long as the framerate
|
||||
stayes over 3 FPS. */
|
||||
stayes over 1 FPS. */
|
||||
if ( ogg_numbufs == 0 )
|
||||
{
|
||||
ogg_numbufs = active_buffers + 24;
|
||||
ogg_numbufs = active_buffers + 64;
|
||||
}
|
||||
|
||||
/* active_buffers are all active OpenAL buffers,
|
||||
|
|
Loading…
Reference in a new issue