mmeFreeBuffer(3mms) — Subroutines
Name
mmeFreeBuffer --- Release a previously allocated data buffer
Syntax
#include <mme/mme_api.h>
BOOL mmeFreeBuffer(void ∗ pointer)
Arguments
void ∗ pointer
Specifies a pointer to the buffer to release.
Description
The mmeFreeBuffer function releases a buffer that was previously allocated with the mmeAllocBuffer or mmeAllocBufferAndGetShminfo function.
Before an application attempts to free a buffer, it must check to ensure that the data in the buffer has been completely processed. For example, if an application reads data into a buffer and then writes the data out to an audio device, the data might not be completely processed before the next program statement executes. This occurs because it takes time to play an audio buffer. If the buffer is freed too soon, the audio is partially played or not played at all, depending on how far the device gets before the buffer is released.
To ensure that a buffer completes processing, an application can make calls to the mmeWaitForCallbacks and mmeProcessCallbacks functions to wait for and process callbacks before releasing the buffer.
See the mmeWaitForCallbacks(3mms) and mmeProcessCallbacks(3mms) reference pages for more information about waiting for and processing callbacks.
Extensions
The mmeFreeBuffer function is a Digital extension to the Microsoft multimedia API specification.
Return Values
Returns TRUE if the function is successful; otherwise, it returns FALSE. A failure can occur if the memory pointed to is not a valid memory pointer.