Skip to content

Commit

Permalink
stb_vorbis: fix interleaved appends silence at end
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Jan 20, 2024
1 parent fdcecaf commit 776929b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/stb_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -5636,6 +5636,7 @@ int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float
float **outputs;
int len = num_floats / channels;
int n=0;
int r=0;
int z = f->channels;
if (z > channels) z = channels;
while (n < len) {
Expand All @@ -5652,7 +5653,9 @@ int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float
f->channel_buffer_start += k;
if (n == len)
break;
if (!stb_vorbis_get_frame_float(f, NULL, &outputs))
r = stb_vorbis_get_frame_float(f, NULL, &outputs);
n = n - k + r;
if (!r)
break;
}
f->current_playback_loc += n;
Expand Down

0 comments on commit 776929b

Please sign in to comment.