Skip to content

Commit a8200ee

Browse files
codylicoSiegeLord
authored andcommitted
Repair audio playmode return value
This commit modifies two parts of the `al_set_audio_stream_playmode` function: - The return boolean is actually returned rather than discarded. - The loop-without-feeder prevention is re-enabled for playmode `ALLEGRO_PLAYMODE_LOOP`. Now only audio streams created by `al_load_audio_stream` should allow the LOOP playmode.
1 parent 6894648 commit a8200ee

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

addons/audio/kcm_stream.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,18 +475,19 @@ bool al_set_audio_stream_playmode(ALLEGRO_AUDIO_STREAM *stream,
475475
else if (val == ALLEGRO_PLAYMODE_LOOP) {
476476
/* Only streams creating by al_load_audio_stream() support
477477
* looping. */
478-
if (!stream->feeder)
478+
if (!stream->feeder) {
479479
ret = false;
480-
481-
stream->spl.loop = _ALLEGRO_PLAYMODE_STREAM_ONEDIR;
482-
ret = true;
480+
} else {
481+
stream->spl.loop = _ALLEGRO_PLAYMODE_STREAM_ONEDIR;
482+
ret = true;
483+
}
483484
}
484485
if (ret) {
485486
stream->is_draining = false;
486487
}
487488

488489
// XXX _al_set_error
489-
return false;
490+
return ret;
490491
}
491492

492493

0 commit comments

Comments
 (0)