mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Fix a bug where sounds loaded with MA_SOUND_FLAG_DECODE do not loop.
This commit is contained in:
@@ -3,6 +3,7 @@ v0.11.22 - TBD
|
|||||||
* Add `MA_SOUND_FLAG_LOOPING` and `MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING` flags. These can be used to initialize sounds and resource managed data sources to loop by default. This is the recommended way to enable looping for streams. The `isLooping` config option in `ma_sound_config` and `ma_resource_manager_data_source_config` has been deprecated. If you are using those, you should switch to the new flag or else you'll get compiler errors when upgrading to a future version.
|
* Add `MA_SOUND_FLAG_LOOPING` and `MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING` flags. These can be used to initialize sounds and resource managed data sources to loop by default. This is the recommended way to enable looping for streams. The `isLooping` config option in `ma_sound_config` and `ma_resource_manager_data_source_config` has been deprecated. If you are using those, you should switch to the new flag or else you'll get compiler errors when upgrading to a future version.
|
||||||
* Fix a bug relating to node detachment.
|
* Fix a bug relating to node detachment.
|
||||||
* Fix a bug where amplification with `ma_device_set_master_volume()` does not work.
|
* Fix a bug where amplification with `ma_device_set_master_volume()` does not work.
|
||||||
|
* Fix a bug where sounds loaded with `MA_SOUND_FLAG_DECODE` do not loop.
|
||||||
* ALSA: Fix some warnings relating to unhandled return value of `read()`.
|
* ALSA: Fix some warnings relating to unhandled return value of `read()`.
|
||||||
* DirectSound: Add support for specifying an explicit window handle for SetCooperativeLevel().
|
* DirectSound: Add support for specifying an explicit window handle for SetCooperativeLevel().
|
||||||
* Web: Fix ScriptProcessorNode path when compiling with `--closure=1`. Note that the Audio Worklets path is not currently working due to the callback specified in `emscripten_create_wasm_audio_worklet_processor_async` never getting fired.
|
* Web: Fix ScriptProcessorNode path when compiling with `--closure=1`. Note that the Audio Worklets path is not currently working due to the callback specified in `emscripten_create_wasm_audio_worklet_processor_async` never getting fired.
|
||||||
|
|||||||
+8
-1
@@ -69210,7 +69210,8 @@ MA_API ma_result ma_resource_manager_data_buffer_read_pcm_frames(ma_resource_man
|
|||||||
isDecodedBufferBusy = (ma_resource_manager_data_buffer_node_result(pDataBuffer->pNode) == MA_BUSY);
|
isDecodedBufferBusy = (ma_resource_manager_data_buffer_node_result(pDataBuffer->pNode) == MA_BUSY);
|
||||||
|
|
||||||
if (ma_resource_manager_data_buffer_get_available_frames(pDataBuffer, &availableFrames) == MA_SUCCESS) {
|
if (ma_resource_manager_data_buffer_get_available_frames(pDataBuffer, &availableFrames) == MA_SUCCESS) {
|
||||||
/* Don't try reading more than the available frame count. */
|
/* Don't try reading more than the available frame count if the data buffer node is still loading. */
|
||||||
|
if (isDecodedBufferBusy) {
|
||||||
if (frameCount > availableFrames) {
|
if (frameCount > availableFrames) {
|
||||||
frameCount = availableFrames;
|
frameCount = availableFrames;
|
||||||
|
|
||||||
@@ -69227,6 +69228,12 @@ MA_API ma_result ma_resource_manager_data_buffer_read_pcm_frames(ma_resource_man
|
|||||||
} else {
|
} else {
|
||||||
isDecodedBufferBusy = MA_FALSE; /* We have enough frames available in the buffer to avoid a MA_BUSY status. */
|
isDecodedBufferBusy = MA_FALSE; /* We have enough frames available in the buffer to avoid a MA_BUSY status. */
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
Getting here means the buffer has been fully loaded. We can just pass the frame count straight
|
||||||
|
into ma_data_source_read_pcm_frames() below and let ma_data_source handle it.
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user