mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-07-31 16:59:16 +02:00
minor changes and optimizations
This commit is contained in:
+2
-2
@@ -35,13 +35,13 @@ typedef struct {
|
||||
} AudioBuffer;
|
||||
|
||||
AudioBuffer* create_audio_buffer(int capacity) {
|
||||
AudioBuffer* buffer = (AudioBuffer*)malloc(sizeof(AudioBuffer));
|
||||
AudioBuffer* buffer = (AudioBuffer*)calloc(sizeof(AudioBuffer));
|
||||
if (!buffer) {
|
||||
perror("Failed to allocate audio buffer");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buffer->packets = (AudioPacket*)malloc(capacity * sizeof(AudioPacket));
|
||||
buffer->packets = (AudioPacket*)calloc(capacity * sizeof(AudioPacket));
|
||||
if (!buffer->packets) {
|
||||
perror("Failed to allocate packet buffer");
|
||||
free(buffer);
|
||||
|
||||
Reference in New Issue
Block a user