mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
Fix some static analaysis warnings.
This commit is contained in:
@@ -42431,7 +42431,6 @@ MA_API ma_result ma_rb_seek_read(ma_rb* pRB, size_t offsetInBytes)
|
||||
writeOffset = pRB->encodedWriteOffset;
|
||||
ma_rb__deconstruct_offset(writeOffset, &writeOffsetInBytes, &writeOffsetLoopFlag);
|
||||
|
||||
newReadOffsetInBytes = readOffsetInBytes;
|
||||
newReadOffsetLoopFlag = readOffsetLoopFlag;
|
||||
|
||||
/* We cannot go past the write buffer. */
|
||||
@@ -42476,7 +42475,6 @@ MA_API ma_result ma_rb_seek_write(ma_rb* pRB, size_t offsetInBytes)
|
||||
writeOffset = pRB->encodedWriteOffset;
|
||||
ma_rb__deconstruct_offset(writeOffset, &writeOffsetInBytes, &writeOffsetLoopFlag);
|
||||
|
||||
newWriteOffsetInBytes = writeOffsetInBytes;
|
||||
newWriteOffsetLoopFlag = writeOffsetLoopFlag;
|
||||
|
||||
/* We cannot go past the write buffer. */
|
||||
|
||||
@@ -1 +1,40 @@
|
||||
#include "../test_deviceio/ma_test_deviceio.c"
|
||||
//#include "../test_deviceio/ma_test_deviceio.c"
|
||||
|
||||
//#define MA_DEBUG_OUTPUT
|
||||
#define MINIAUDIO_IMPLEMENTATION
|
||||
#include "../../miniaudio.h"
|
||||
|
||||
void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount)
|
||||
{
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
ma_result result;
|
||||
ma_device_config deviceConfig;
|
||||
ma_device device;
|
||||
ma_backend backend = ma_backend_null;
|
||||
for(int i=0;i<1000;++i){
|
||||
deviceConfig = ma_device_config_init(ma_device_type_playback);
|
||||
deviceConfig.playback.format = ma_format_f32;
|
||||
deviceConfig.playback.channels = 2;
|
||||
deviceConfig.sampleRate = 44100;
|
||||
deviceConfig.dataCallback = data_callback;
|
||||
deviceConfig.pUserData = NULL;
|
||||
printf("iter: %d\n", i);
|
||||
printf("init\n");
|
||||
if (ma_device_init_ex(&backend, 1, NULL, &deviceConfig, &device) != MA_SUCCESS) {
|
||||
printf("Failed to open playback device.\n");
|
||||
return -1;
|
||||
}
|
||||
printf("start\n");
|
||||
if (ma_device_start(&device) != MA_SUCCESS) {
|
||||
printf("Failed to start playback device.\n");
|
||||
ma_device_uninit(&device);
|
||||
return -1;
|
||||
}
|
||||
printf("uninit\n");
|
||||
ma_device_uninit(&device);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user