mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-29 19:54:05 +02:00
API CHANGE: Add an onSizeof callback to ma_data_source_vtable.
This should return the size of the implementations struct. For example, `ma_decoder` would return `sizeof(ma_decoder)`. This is in preparation for future work to support copying data sources.
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
#include <string.h> /* For memset(). */
|
||||
#include <assert.h>
|
||||
|
||||
static size_t ma_libopus_ds_sizeof(void)
|
||||
{
|
||||
return sizeof(ma_libopus);
|
||||
}
|
||||
|
||||
static void ma_libopus_ds_uninit(ma_data_source* pDataSource)
|
||||
{
|
||||
ma_libopus_uninit((ma_libopus*)pDataSource);
|
||||
@@ -42,6 +47,7 @@ static ma_result ma_libopus_ds_get_length(ma_data_source* pDataSource, ma_uint64
|
||||
|
||||
static ma_data_source_vtable ma_gDataSourceVTable_libopus =
|
||||
{
|
||||
ma_libopus_ds_sizeof,
|
||||
ma_libopus_ds_uninit,
|
||||
ma_libopus_ds_read,
|
||||
ma_libopus_ds_seek,
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
#include <string.h> /* For memset(). */
|
||||
#include <assert.h>
|
||||
|
||||
static size_t ma_libvorbis_ds_sizeof(void)
|
||||
{
|
||||
return sizeof(ma_libvorbis);
|
||||
}
|
||||
|
||||
static void ma_libvorbis_ds_uninit(ma_data_source* pDataSource)
|
||||
{
|
||||
ma_libvorbis_uninit((ma_libvorbis*)pDataSource);
|
||||
@@ -45,6 +50,7 @@ static ma_result ma_libvorbis_ds_get_length(ma_data_source* pDataSource, ma_uint
|
||||
|
||||
static ma_data_source_vtable ma_gDataSourceVTable_libvorbis =
|
||||
{
|
||||
ma_libvorbis_ds_sizeof,
|
||||
ma_libvorbis_ds_uninit,
|
||||
ma_libvorbis_ds_read,
|
||||
ma_libvorbis_ds_seek,
|
||||
|
||||
Reference in New Issue
Block a user