mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
(tinyalsa) Add early return
This commit is contained in:
parent
89b345e262
commit
b7666b56d1
@ -94,9 +94,13 @@ tinyalsa_write(void *data, const void *buf_, size_t size_)
|
|||||||
pcm_sframes_t size = BYTES_TO_FRAMES(size_, tinyalsa->frame_bits);
|
pcm_sframes_t size = BYTES_TO_FRAMES(size_, tinyalsa->frame_bits);
|
||||||
size_t frames_size = tinyalsa->has_float ? sizeof(float) : sizeof(int16_t);
|
size_t frames_size = tinyalsa->has_float ? sizeof(float) : sizeof(int16_t);
|
||||||
|
|
||||||
while (size) {
|
while (size)
|
||||||
|
{
|
||||||
frames = pcm_writei(tinyalsa->pcm, buf, size);
|
frames = pcm_writei(tinyalsa->pcm, buf, size);
|
||||||
|
|
||||||
|
if (frames < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
written += frames;
|
written += frames;
|
||||||
buf += (frames << 1) * frames_size;
|
buf += (frames << 1) * frames_size;
|
||||||
size -= frames;
|
size -= frames;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user