Commit fe29805e authored by David Reid's avatar David Reid Committed by GitHub

Merge pull request #244 from edubart/fix-seek

Fix sound seek in miniaudio engine
parents caad0bc4 e7628382
...@@ -8099,11 +8099,12 @@ static void ma_engine_mix_sound_internal(ma_engine* pEngine, ma_sound_group* pGr ...@@ -8099,11 +8099,12 @@ static void ma_engine_mix_sound_internal(ma_engine* pEngine, ma_sound_group* pGr
/* If we're seeking, do so now before reading. */ /* If we're seeking, do so now before reading. */
if (pSound->seekTarget != MA_SEEK_TARGET_NONE) { if (pSound->seekTarget != MA_SEEK_TARGET_NONE) {
pSound->seekTarget = MA_SEEK_TARGET_NONE;
ma_data_source_seek_to_pcm_frame(pSound->pDataSource, pSound->seekTarget); ma_data_source_seek_to_pcm_frame(pSound->pDataSource, pSound->seekTarget);
/* Any time-dependant effects need to have their times updated. */ /* Any time-dependant effects need to have their times updated. */
ma_engine_effect_set_time(&pSound->effect, pSound->seekTarget); ma_engine_effect_set_time(&pSound->effect, pSound->seekTarget);
pSound->seekTarget = MA_SEEK_TARGET_NONE;
} }
/* If the sound is being delayed we don't want to mix anything, nor do we want to advance time forward from the perspective of the data source. */ /* If the sound is being delayed we don't want to mix anything, nor do we want to advance time forward from the perspective of the data source. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment