mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
API CHANGE: Update ma_decoder_read_pcm_frames().
This makes ma_decoder_read_pcm_frames() consistent with other data sources. It now returns a result code and outputs the number of frames read via an output parameter.
This commit is contained in:
@@ -37,7 +37,7 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
encoderConfig = ma_encoder_config_init(ma_resource_format_wav, ma_format_f32, 2, 44100);
|
||||
encoderConfig = ma_encoder_config_init(ma_encoding_format_wav, ma_format_f32, 2, 44100);
|
||||
|
||||
if (ma_encoder_init_file(argv[1], &encoderConfig, &encoder) != MA_SUCCESS) {
|
||||
printf("Failed to initialize output file.\n");
|
||||
|
||||
@@ -44,7 +44,7 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
encoderConfig = ma_encoder_config_init(ma_resource_format_wav, ma_format_f32, 2, 44100);
|
||||
encoderConfig = ma_encoder_config_init(ma_encoding_format_wav, ma_format_f32, 2, 44100);
|
||||
|
||||
if (ma_encoder_init_file(argv[1], &encoderConfig, &encoder) != MA_SUCCESS) {
|
||||
printf("Failed to initialize output file.\n");
|
||||
|
||||
@@ -61,7 +61,7 @@ ma_uint32 read_and_mix_pcm_frames_f32(ma_decoder* pDecoder, float* pOutputF32, m
|
||||
framesToReadThisIteration = totalFramesRemaining;
|
||||
}
|
||||
|
||||
framesReadThisIteration = (ma_uint32)ma_decoder_read_pcm_frames(pDecoder, temp, framesToReadThisIteration);
|
||||
framesReadThisIteration = (ma_uint32)ma_decoder_read_pcm_frames(pDecoder, temp, framesToReadThisIteration, NULL);
|
||||
if (framesReadThisIteration == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
|
||||
return;
|
||||
}
|
||||
|
||||
ma_decoder_read_pcm_frames(pDecoder, pOutput, frameCount);
|
||||
ma_decoder_read_pcm_frames(pDecoder, pOutput, frameCount, NULL);
|
||||
|
||||
(void)pInput;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user