Skip to content

Commit

Permalink
Slight performance fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Apr 13, 2023
1 parent 7255406 commit 6296bc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oswrapper_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,8 @@ OSWRAPPER_AUDIO_DEF size_t oswrapper_audio_get_samples(OSWrapper_audio_spec* aud
frame_size = (audio->bits_per_channel / 8) * audio->channel_count;

/* We have to buffer decoding ourselves due to API quirks */
if (internal_data->internal_buffer_remaining < (frames_to_do * frame_size)) {
oswrapper_audio__get_new_samples(audio, frames_to_do * frame_size);
if (internal_data->internal_buffer_remaining < (frames_to_do * frame_size / sizeof(short))) {
oswrapper_audio__get_new_samples(audio, frames_to_do * frame_size / sizeof(short));
}

if (internal_data->internal_buffer_remaining < (frames_to_do * frame_size / sizeof(short))) {
Expand Down

0 comments on commit 6296bc8

Please sign in to comment.