mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 15:24:22 -04:00
Merge pull request #160 from E5ten/posix_memalign
tinywavinfo: replace obsolete memalign with posix_memalign
This commit is contained in:
+1
-3
@@ -32,7 +32,6 @@
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <math.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#define ID_RIFF 0x46464952
|
||||
#define ID_WAVE 0x45564157
|
||||
@@ -155,9 +154,8 @@ void analyse_sample(FILE *file, unsigned int channels, unsigned int bits,
|
||||
normalization_factor = (float)pow(2.0, (bits-1));
|
||||
|
||||
size = channels * byte_align * frame_size;
|
||||
buffer = memalign(byte_align, size);
|
||||
|
||||
if (!buffer) {
|
||||
if (posix_memalign(&buffer, byte_align, size)) {
|
||||
fprintf(stderr, "Unable to allocate %d bytes\n", size);
|
||||
free(buffer);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user