mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2025-01-03 16:15:27 +00:00
ALSA: fix sometimes calling write_callback with 0 frame_count_max
This commit is contained in:
parent
1d2cf2ed59
commit
06dc7704a3
|
@ -62,7 +62,7 @@ static void write_callback(struct SoundIoOutStream *outstream, int frame_count_m
|
|||
for (;;) {
|
||||
int frame_count = frames_left;
|
||||
if ((err = soundio_outstream_begin_write(outstream, &areas, &frame_count))) {
|
||||
fprintf(stderr, "%s\n", soundio_strerror(err));
|
||||
fprintf(stderr, "unrecoverable stream error: %s\n", soundio_strerror(err));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ static void write_callback(struct SoundIoOutStream *outstream, int frame_count_m
|
|||
if ((err = soundio_outstream_end_write(outstream))) {
|
||||
if (err == SoundIoErrorUnderflow)
|
||||
return;
|
||||
fprintf(stderr, "%s\n", soundio_strerror(err));
|
||||
fprintf(stderr, "unrecoverable stream error: %s\n", soundio_strerror(err));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1091,7 +1091,8 @@ void outstream_thread_run(void *arg) {
|
|||
continue;
|
||||
}
|
||||
|
||||
outstream->write_callback(outstream, 0, avail);
|
||||
if (avail > 0)
|
||||
outstream->write_callback(outstream, 0, avail);
|
||||
continue;
|
||||
}
|
||||
case SND_PCM_STATE_XRUN:
|
||||
|
|
Loading…
Reference in a new issue