Skip to content

Commit d010528

Browse files
committed
acap/fluidsynth: use usleep
+ remove todo in sdl3 + add deprecate to sdl_mixer
1 parent 9a738c9 commit d010528

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/audio/capture/fluidsynth.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "audio/audio_capture.h" // for AUDIO_CAPTURE_ABI_VERSION, audio_ca...
4848
#include "audio/types.h" // for audio_frame
4949
#include "audio/utils.h" // for mux_channel
50+
#include "compat/usleep.h" // for usleep
5051
#include "debug.h" // for LOG_LEVEL_ERROR, MSG, log_msg, LOG_...
5152
#include "host.h" // for audio_capture_sample_rate, INIT_NOERR
5253
#include "lib_common.h" // for REGISTER_MODULE, library_class
@@ -318,10 +319,8 @@ audio_cap_fluidsynth_read(void *state)
318319
if (t > s->next_frame_time + s->frame_interval) {
319320
MSG(WARNING, "Some data missed!\n");
320321
t = s->next_frame_time;
321-
} else {
322-
while (t < s->next_frame_time) {
323-
t = get_time_in_ns();
324-
}
322+
} else if (t < s->next_frame_time){
323+
usleep((s->next_frame_time - t) / US_IN_NS);
325324
}
326325
s->next_frame_time += s->frame_interval;
327326

src/audio/capture/sdl_mixer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ adjust_ch_count(struct state_sdl_mixer_capture *s)
226226

227227
static void * audio_cap_sdl_mixer_init(struct module *parent, const char *cfg)
228228
{
229+
MSG(WARNING, "SDL_mixer is deprecated, used fluidsynth...\n");
229230
UNUSED(parent);
230231
SDL_Init(SDL_INIT_AUDIO);
231232

src/video_display/sdl3.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
* (segfaults - wrong pitch/texture?)
5050
* 3. p010 works just on macOS/Metal, crashes on Vulkan (see previous point)
5151
* 4. p010 corrupted on d3d[12] - pixfmts skipped in query*() as a workaround
52-
* 5. see todo in @ref ../audio/capture/sdl_mixer.c
5352
*/
5453

5554
#include <SDL3/SDL.h>

0 commit comments

Comments
 (0)