2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2007 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
21 #define _CRT_SECURE_NO_DEPRECATE // get rid of sprintf security warnings on VS2005
35 * AL Buffers are shared amoung Contexts, so we store the list of generated Buffers
36 * as a global variable in this module. (A valid context is not required to make
37 * AL Buffer function calls
45 static ALbuffer
*g_pBuffers
= NULL
; // Linked List of Buffers
46 static ALuint g_uiBufferCount
= 0; // Buffer Count
48 static const long g_IMAStep_size
[89]={ // IMA ADPCM Stepsize table
49 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31,
50 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143,
51 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658,
52 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024,
53 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493,10442,11487,12635,13899,
54 15289,16818,18500,20350,22358,24633,27086,29794,32767
57 static const long g_IMACodeword_4
[16]={ // IMA4 ADPCM Codeword decode table
58 1, 3, 5, 7, 9, 11, 13, 15,
59 -1,-3,-5,-7,-9,-11,-13,-15,
62 static const long g_IMAIndex_adjust_4
[16]={ // IMA4 ADPCM Step index adjust decode table
63 -1,-1,-1,-1, 2, 4, 6, 8,
64 -1,-1,-1,-1, 2, 4, 6, 8
68 * alGenBuffers(ALsizei n, ALuint *puiBuffers)
70 * Generates n AL Buffers, and stores the Buffers Names in the array pointed to by puiBuffers
72 ALAPI ALvoid ALAPIENTRY
alGenBuffers(ALsizei n
,ALuint
*puiBuffers
)
77 Context
= alcGetCurrentContext();
78 SuspendContext(Context
);
80 // Check that we are actually generation some Buffers
83 // Check the pointer is valid (and points to enough memory to store Buffer Names)
84 if (!IsBadWritePtr((void*)puiBuffers
, n
* sizeof(ALuint
)))
86 ALbuffer
**list
= &g_pBuffers
;
88 list
= &(*list
)->next
;
90 // Create all the new Buffers
93 *list
= calloc(1, sizeof(ALbuffer
));
96 puiBuffers
[i
] = (ALuint
)ALTHUNK_ADDENTRY(*list
);
97 (*list
)->state
= UNUSED
;
101 list
= &(*list
)->next
;
105 // If we didn't create all the Buffers, we must have run out of memory
107 alSetError(AL_OUT_OF_MEMORY
);
111 // Pointer does not point to enough memory to write Buffer names
112 alSetError(AL_INVALID_VALUE
);
116 ProcessContext(Context
);
122 * alDeleteBuffers(ALsizei n, ALuint *puiBuffers)
124 * Deletes the n AL Buffers pointed to by puiBuffers
126 ALAPI ALvoid ALAPIENTRY
alDeleteBuffers(ALsizei n
, const ALuint
*puiBuffers
)
131 ALboolean bFailed
= AL_FALSE
;
133 Context
= alcGetCurrentContext();
134 SuspendContext(Context
);
136 // Check we are actually Deleting some Buffers
139 if ((ALuint
)n
<= g_uiBufferCount
)
141 // Check that all the buffers are valid and can actually be deleted
142 for (i
= 0; i
< n
; i
++)
144 // Check for valid Buffer ID (can be NULL buffer)
145 if (alIsBuffer(puiBuffers
[i
]))
147 // If not the NULL buffer, check that the reference count is 0
148 ALBuf
= ((ALbuffer
*)ALTHUNK_LOOKUPENTRY(puiBuffers
[i
]));
151 if (ALBuf
->refcount
!= 0)
153 // Buffer still in use, cannot be deleted
154 alSetError(AL_INVALID_OPERATION
);
162 alSetError(AL_INVALID_NAME
);
167 // If all the Buffers were valid (and have Reference Counts of 0), then we can delete them
170 for (i
= 0; i
< n
; i
++)
172 ALBuf
=((ALbuffer
*)ALTHUNK_LOOKUPENTRY(puiBuffers
[i
]));
175 ALbuffer
**list
= &g_pBuffers
;
176 while(*list
&& *list
!= ALBuf
)
177 list
= &(*list
)->next
;
180 *list
= (*list
)->next
;
182 // Release the memory used to store audio data
185 // Release buffer structure
186 ALTHUNK_REMOVEENTRY(puiBuffers
[i
]);
187 memset(ALBuf
, 0, sizeof(ALbuffer
));
195 alSetError(AL_INVALID_NAME
);
198 alSetError(AL_INVALID_VALUE
);
200 ProcessContext(Context
);
207 * alIsBuffer(ALuint uiBuffer)
209 * Checks if ulBuffer is a valid Buffer Name
211 ALAPI ALboolean ALAPIENTRY
alIsBuffer(ALuint uiBuffer
)
214 ALboolean result
=AL_FALSE
;
218 Context
= alcGetCurrentContext();
219 SuspendContext(Context
);
223 TgtALBuf
= (ALbuffer
*)ALTHUNK_LOOKUPENTRY(uiBuffer
);
225 // Check through list of generated buffers for uiBuffer
229 if (ALBuf
== TgtALBuf
)
244 ProcessContext(Context
);
250 * alBufferData(ALuint buffer,ALenum format,ALvoid *data,ALsizei size,ALsizei freq)
252 * Fill buffer with audio data
254 ALAPI ALvoid ALAPIENTRY
alBufferData(ALuint buffer
,ALenum format
,const ALvoid
*data
,ALsizei size
,ALsizei freq
)
256 ALuint
*IMAData
,IMACode
;
259 ALint LeftSample
,LeftIndex
;
260 ALint RightSample
,RightIndex
;
261 ALuint LeftIMACode
,RightIMACode
;
265 Context
= alcGetCurrentContext();
266 SuspendContext(Context
);
268 if (alIsBuffer(buffer
) && (buffer
!= 0))
270 ALBuf
=((ALbuffer
*)ALTHUNK_LOOKUPENTRY(buffer
));
271 if ((ALBuf
->refcount
==0)&&(data
))
275 case AL_FORMAT_MONO8
:
278 // 8bit Samples are converted to 16 bit here
279 // Allocate 8 extra samples (16 bytes)
280 ALBuf
->data
=realloc(ALBuf
->data
,16+(size
/sizeof(ALubyte
))*(1*sizeof(ALshort
)));
283 ALBuf
->format
= AL_FORMAT_MONO16
;
284 ALBuf
->eOriginalFormat
= AL_FORMAT_MONO8
;
285 for (i
=0;i
<(ALsizei
)(size
/sizeof(ALubyte
));i
++)
286 ALBuf
->data
[i
]=(ALshort
)((((ALubyte
*)data
)[i
]-128)<<8);
287 memset(&(ALBuf
->data
[size
/sizeof(ALubyte
)]), 0, 16);
288 ALBuf
->size
=size
/sizeof(ALubyte
)*1*sizeof(ALshort
);
289 ALBuf
->frequency
=freq
;
292 alSetError(AL_OUT_OF_MEMORY
);
295 alSetError(AL_INVALID_VALUE
);
298 case AL_FORMAT_MONO16
:
301 // Allocate 8 extra samples (16 bytes)
302 ALBuf
->data
=realloc(ALBuf
->data
,16+(size
/sizeof(ALshort
))*(1*sizeof(ALshort
)));
305 ALBuf
->format
= AL_FORMAT_MONO16
;
306 ALBuf
->eOriginalFormat
= AL_FORMAT_MONO16
;
307 memcpy(ALBuf
->data
,data
,size
/sizeof(ALshort
)*1*sizeof(ALshort
));
308 memset(&(ALBuf
->data
[size
/sizeof(ALshort
)]), 0, 16);
309 ALBuf
->size
=size
/sizeof(ALshort
)*1*sizeof(ALshort
);
310 ALBuf
->frequency
=freq
;
313 alSetError(AL_OUT_OF_MEMORY
);
316 alSetError(AL_INVALID_VALUE
);
319 case AL_FORMAT_STEREO8
:
322 // 8bit Samples are converted to 16 bit here
323 // Allocate 8 extra samples (32 bytes)
324 ALBuf
->data
=realloc(ALBuf
->data
,32+(size
/sizeof(ALubyte
))*(1*sizeof(ALshort
)));
327 ALBuf
->format
= AL_FORMAT_STEREO16
;
328 ALBuf
->eOriginalFormat
= AL_FORMAT_STEREO8
;
329 for (i
=0;i
<(ALsizei
)(size
/sizeof(ALubyte
));i
++)
330 ALBuf
->data
[i
]=(ALshort
)((((ALubyte
*)data
)[i
]-128)<<8);
331 memset(&(ALBuf
->data
[size
/sizeof(ALubyte
)]), 0, 32);
332 ALBuf
->size
=size
/sizeof(ALubyte
)*1*sizeof(ALshort
);
333 ALBuf
->frequency
=freq
;
336 alSetError(AL_OUT_OF_MEMORY
);
339 alSetError(AL_INVALID_VALUE
);
342 case AL_FORMAT_STEREO16
:
345 // Allocate 8 extra samples (32 bytes)
346 ALBuf
->data
=realloc(ALBuf
->data
,32+(size
/sizeof(ALshort
))*(1*sizeof(ALshort
)));
349 ALBuf
->format
= AL_FORMAT_STEREO16
;
350 ALBuf
->eOriginalFormat
= AL_FORMAT_STEREO16
;
351 memcpy(ALBuf
->data
,data
,size
/sizeof(ALshort
)*1*sizeof(ALshort
));
352 memset(&(ALBuf
->data
[size
/sizeof(ALshort
)]), 0, 32);
353 ALBuf
->size
=size
/sizeof(ALshort
)*1*sizeof(ALshort
);
354 ALBuf
->frequency
=freq
;
357 alSetError(AL_OUT_OF_MEMORY
);
360 alSetError(AL_INVALID_VALUE
);
363 case AL_FORMAT_MONO_IMA4
:
364 // Here is where things vary:
365 // nVidia and Apple use 64+1 samples per block => block_size=36 bytes
366 // Most PC sound software uses 2040+1 samples per block -> block_size=1024 bytes
369 // Allocate 8 extra samples (16 bytes)
370 ALBuf
->data
=realloc(ALBuf
->data
,16+(size
/36)*(65*sizeof(ALshort
)));
373 ALBuf
->format
= AL_FORMAT_MONO16
;
374 ALBuf
->eOriginalFormat
= AL_FORMAT_MONO_IMA4
;
375 IMAData
=(ALuint
*)data
;
376 for (i
=0;i
<size
/36;i
++)
378 Sample
=((ALshort
*)IMAData
)[0];
379 Index
=((ALshort
*)IMAData
)[1];
381 Index
=Index
<0?0:Index
;
382 Index
=Index
>88?88:Index
;
384 ALBuf
->data
[i
*65]=(short)Sample
;
393 Sample
+=((g_IMAStep_size
[Index
]*g_IMACodeword_4
[IMACode
&15])/8);
394 Index
+=g_IMAIndex_adjust_4
[IMACode
&15];
395 if (Sample
<-32768) Sample
=-32768;
396 else if (Sample
>32767) Sample
=32767;
397 if (Index
<0) Index
=0;
398 else if (Index
>88) Index
=88;
399 ALBuf
->data
[i
*65+j
+k
]=(short)Sample
;
402 Sample
+=((g_IMAStep_size
[Index
]*g_IMACodeword_4
[IMACode
&15])/8);
403 Index
+=g_IMAIndex_adjust_4
[IMACode
&15];
404 if (Sample
<-32768) Sample
=-32768;
405 else if (Sample
>32767) Sample
=32767;
406 if (Index
<0) Index
=0;
407 else if (Index
>88) Index
=88;
408 ALBuf
->data
[i
*65+j
+k
+1]=(short)Sample
;
414 memset(&(ALBuf
->data
[(size
/36*65)]), 0, 16);
415 ALBuf
->size
=size
/36*65*sizeof(ALshort
);
416 ALBuf
->frequency
=freq
;
419 alSetError(AL_OUT_OF_MEMORY
);
422 alSetError(AL_INVALID_VALUE
);
425 case AL_FORMAT_STEREO_IMA4
:
426 // Here is where things vary:
427 // nVidia and Apple use 64+1 samples per channel per block => block_size=72 bytes
428 // Most PC sound software uses 2040+1 samples per channel per block -> block_size=2048 bytes
431 // Allocate 8 extra samples (32 bytes)
432 ALBuf
->data
=realloc(ALBuf
->data
,32+(size
/72)*(2*65*sizeof(ALshort
)));
435 ALBuf
->format
= AL_FORMAT_STEREO16
;
436 ALBuf
->eOriginalFormat
= AL_FORMAT_STEREO_IMA4
;
437 IMAData
=(ALuint
*)data
;
438 for (i
=0;i
<size
/72;i
++)
440 LeftSample
=((ALshort
*)IMAData
)[0];
441 LeftIndex
=((ALshort
*)IMAData
)[1];
443 LeftIndex
=LeftIndex
<0?0:LeftIndex
;
444 LeftIndex
=LeftIndex
>88?88:LeftIndex
;
446 ALBuf
->data
[i
*2*65]=(short)LeftSample
;
450 RightSample
=((ALshort
*)IMAData
)[0];
451 RightIndex
=((ALshort
*)IMAData
)[1];
453 RightIndex
=RightIndex
<0?0:RightIndex
;
454 RightIndex
=RightIndex
>88?88:RightIndex
;
456 ALBuf
->data
[i
*2*65+1]=(short)RightSample
;
460 for (j
=2;j
<130;j
+=16)
462 LeftIMACode
=IMAData
[0];
463 RightIMACode
=IMAData
[1];
466 LeftSample
+=((g_IMAStep_size
[LeftIndex
]*g_IMACodeword_4
[LeftIMACode
&15])/8);
467 LeftIndex
+=g_IMAIndex_adjust_4
[LeftIMACode
&15];
468 if (LeftSample
<-32768) LeftSample
=-32768;
469 else if (LeftSample
>32767) LeftSample
=32767;
470 if (LeftIndex
<0) LeftIndex
=0;
471 else if (LeftIndex
>88) LeftIndex
=88;
472 ALBuf
->data
[i
*2*65+j
+k
]=(short)LeftSample
;
475 RightSample
+=((g_IMAStep_size
[RightIndex
]*g_IMACodeword_4
[RightIMACode
&15])/8);
476 RightIndex
+=g_IMAIndex_adjust_4
[RightIMACode
&15];
477 if (RightSample
<-32768) RightSample
=-32768;
478 else if (RightSample
>32767) RightSample
=32767;
479 if (RightIndex
<0) RightIndex
=0;
480 else if (RightIndex
>88) RightIndex
=88;
481 ALBuf
->data
[i
*2*65+j
+k
+1]=(short)RightSample
;
484 LeftSample
+=((g_IMAStep_size
[LeftIndex
]*g_IMACodeword_4
[LeftIMACode
&15])/8);
485 LeftIndex
+=g_IMAIndex_adjust_4
[LeftIMACode
&15];
486 if (LeftSample
<-32768) LeftSample
=-32768;
487 else if (LeftSample
>32767) LeftSample
=32767;
488 if (LeftIndex
<0) LeftIndex
=0;
489 else if (LeftIndex
>88) LeftIndex
=88;
490 ALBuf
->data
[i
*2*65+j
+k
+2]=(short)LeftSample
;
493 RightSample
+=((g_IMAStep_size
[RightIndex
]*g_IMACodeword_4
[RightIMACode
&15])/8);
494 RightIndex
+=g_IMAIndex_adjust_4
[RightIMACode
&15];
495 if (RightSample
<-32768) RightSample
=-32768;
496 else if (RightSample
>32767) RightSample
=32767;
497 if (RightIndex
<0) RightIndex
=0;
498 else if (RightIndex
>88) RightIndex
=88;
499 ALBuf
->data
[i
*2*65+j
+k
+3]=(short)RightSample
;
505 memset(&(ALBuf
->data
[(size
/72*2*65)]), 0, 32);
506 ALBuf
->size
=size
/72*2*65*sizeof(ALshort
);
507 ALBuf
->frequency
=freq
;
510 alSetError(AL_OUT_OF_MEMORY
);
513 alSetError(AL_INVALID_VALUE
);
517 alSetError(AL_INVALID_ENUM
);
523 // Buffer is in use, or data is a NULL pointer
524 alSetError(AL_INVALID_VALUE
);
529 // Invalid Buffer Name
530 alSetError(AL_INVALID_NAME
);
533 ProcessContext(Context
);
537 ALAPI
void ALAPIENTRY
alBufferf(ALuint buffer
, ALenum eParam
, ALfloat flValue
)
539 ALCcontext
*pContext
;
543 pContext
= alcGetCurrentContext();
544 SuspendContext(pContext
);
546 if (alIsBuffer(buffer
) && (buffer
!= 0))
551 alSetError(AL_INVALID_ENUM
);
557 alSetError(AL_INVALID_NAME
);
560 ProcessContext(pContext
);
564 ALAPI
void ALAPIENTRY
alBuffer3f(ALuint buffer
, ALenum eParam
, ALfloat flValue1
, ALfloat flValue2
, ALfloat flValue3
)
566 ALCcontext
*pContext
;
572 pContext
= alcGetCurrentContext();
573 SuspendContext(pContext
);
575 if (alIsBuffer(buffer
) && (buffer
!= 0))
580 alSetError(AL_INVALID_ENUM
);
586 alSetError(AL_INVALID_NAME
);
589 ProcessContext(pContext
);
593 ALAPI
void ALAPIENTRY
alBufferfv(ALuint buffer
, ALenum eParam
, const ALfloat
* flValues
)
595 ALCcontext
*pContext
;
599 pContext
= alcGetCurrentContext();
600 SuspendContext(pContext
);
602 if (alIsBuffer(buffer
) && (buffer
!= 0))
607 alSetError(AL_INVALID_ENUM
);
613 alSetError(AL_INVALID_NAME
);
616 ProcessContext(pContext
);
620 ALAPI
void ALAPIENTRY
alBufferi(ALuint buffer
, ALenum eParam
, ALint lValue
)
622 ALCcontext
*pContext
;
626 pContext
= alcGetCurrentContext();
627 SuspendContext(pContext
);
629 if (alIsBuffer(buffer
) && (buffer
!= 0))
634 alSetError(AL_INVALID_ENUM
);
640 alSetError(AL_INVALID_NAME
);
643 ProcessContext(pContext
);
647 ALAPI
void ALAPIENTRY
alBuffer3i( ALuint buffer
, ALenum eParam
, ALint lValue1
, ALint lValue2
, ALint lValue3
)
649 ALCcontext
*pContext
;
655 pContext
= alcGetCurrentContext();
656 SuspendContext(pContext
);
658 if (alIsBuffer(buffer
) && (buffer
!= 0))
663 alSetError(AL_INVALID_ENUM
);
669 alSetError(AL_INVALID_NAME
);
672 ProcessContext(pContext
);
676 ALAPI
void ALAPIENTRY
alBufferiv(ALuint buffer
, ALenum eParam
, const ALint
* plValues
)
678 ALCcontext
*pContext
;
682 pContext
= alcGetCurrentContext();
683 SuspendContext(pContext
);
685 if (alIsBuffer(buffer
) && (buffer
!= 0))
690 alSetError(AL_INVALID_ENUM
);
696 alSetError(AL_INVALID_NAME
);
699 ProcessContext(pContext
);
703 ALAPI ALvoid ALAPIENTRY
alGetBufferf(ALuint buffer
, ALenum eParam
, ALfloat
*pflValue
)
705 ALCcontext
*pContext
;
707 pContext
= alcGetCurrentContext();
708 SuspendContext(pContext
);
712 if (alIsBuffer(buffer
) && (buffer
!= 0))
717 alSetError(AL_INVALID_ENUM
);
723 alSetError(AL_INVALID_NAME
);
728 alSetError(AL_INVALID_VALUE
);
731 ProcessContext(pContext
);
735 ALAPI
void ALAPIENTRY
alGetBuffer3f(ALuint buffer
, ALenum eParam
, ALfloat
* pflValue1
, ALfloat
* pflValue2
, ALfloat
* pflValue3
)
737 ALCcontext
*pContext
;
739 pContext
= alcGetCurrentContext();
740 SuspendContext(pContext
);
742 if ((pflValue1
) && (pflValue2
) && (pflValue3
))
744 if (alIsBuffer(buffer
) && (buffer
!= 0))
749 alSetError(AL_INVALID_ENUM
);
755 alSetError(AL_INVALID_NAME
);
760 alSetError(AL_INVALID_VALUE
);
763 ProcessContext(pContext
);
767 ALAPI
void ALAPIENTRY
alGetBufferfv(ALuint buffer
, ALenum eParam
, ALfloat
* pflValues
)
769 ALCcontext
*pContext
;
771 pContext
= alcGetCurrentContext();
772 SuspendContext(pContext
);
776 if (alIsBuffer(buffer
) && (buffer
!= 0))
781 alSetError(AL_INVALID_ENUM
);
787 alSetError(AL_INVALID_NAME
);
792 alSetError(AL_INVALID_VALUE
);
795 ProcessContext(pContext
);
799 ALAPI ALvoid ALAPIENTRY
alGetBufferi(ALuint buffer
, ALenum eParam
, ALint
*plValue
)
801 ALCcontext
*pContext
;
804 pContext
= alcGetCurrentContext();
805 SuspendContext(pContext
);
809 if (alIsBuffer(buffer
) && (buffer
!= 0))
811 pBuffer
= ((ALbuffer
*)ALTHUNK_LOOKUPENTRY(buffer
));
816 *plValue
= pBuffer
->frequency
;
820 *plValue
= (((pBuffer
->format
==AL_FORMAT_MONO8
)||(pBuffer
->format
==AL_FORMAT_STEREO8
))?8:16);
824 *plValue
= (((pBuffer
->format
==AL_FORMAT_MONO8
)||(pBuffer
->format
==AL_FORMAT_MONO16
))?1:2);
828 *plValue
= pBuffer
->size
;
832 alSetError(AL_INVALID_ENUM
);
838 alSetError(AL_INVALID_NAME
);
843 alSetError(AL_INVALID_VALUE
);
846 ProcessContext(pContext
);
850 ALAPI
void ALAPIENTRY
alGetBuffer3i(ALuint buffer
, ALenum eParam
, ALint
* plValue1
, ALint
* plValue2
, ALint
* plValue3
)
852 ALCcontext
*pContext
;
854 pContext
= alcGetCurrentContext();
855 SuspendContext(pContext
);
857 if ((plValue1
) && (plValue2
) && (plValue3
))
859 if (alIsBuffer(buffer
) && (buffer
!= 0))
864 alSetError(AL_INVALID_ENUM
);
870 alSetError(AL_INVALID_NAME
);
875 alSetError(AL_INVALID_VALUE
);
878 ProcessContext(pContext
);
882 ALAPI
void ALAPIENTRY
alGetBufferiv(ALuint buffer
, ALenum eParam
, ALint
* plValues
)
884 ALCcontext
*pContext
;
886 pContext
= alcGetCurrentContext();
887 SuspendContext(pContext
);
891 if (alIsBuffer(buffer
) && (buffer
!= 0))
899 alGetBufferi(buffer
, eParam
, plValues
);
903 alSetError(AL_INVALID_ENUM
);
909 alSetError(AL_INVALID_NAME
);
914 alSetError(AL_INVALID_VALUE
);
917 ProcessContext(pContext
);
924 * INTERNAL FN : Called by DLLMain on exit to destroy any buffers that still exist
926 ALvoid
ReleaseALBuffers(ALvoid
)
929 ALbuffer
*ALBufferTemp
;
932 if(g_uiBufferCount
> 0)
933 AL_PRINT("exit() %d Buffer(s) NOT deleted\n", g_uiBufferCount
);
936 ALBuffer
= g_pBuffers
;
939 // Release sample data
940 free(ALBuffer
->data
);
942 // Release Buffer structure
943 ALBufferTemp
= ALBuffer
;
944 ALBuffer
= ALBuffer
->next
;
945 memset(ALBufferTemp
, 0, sizeof(ALbuffer
));