handling of end of .ogg file
This commit is contained in:
parent
8a8f62dc25
commit
3bd25b2067
10
src/audio.c
10
src/audio.c
@ -180,6 +180,16 @@ static void audio_sample_and_mixin_channel(struct audio_channel *channel,
|
|||||||
(int16_t *)buffer,
|
(int16_t *)buffer,
|
||||||
n_frames);
|
n_frames);
|
||||||
|
|
||||||
|
/* handle end of file */
|
||||||
|
if (samples_per_channel == 0) {
|
||||||
|
if (channel->args.repeat)
|
||||||
|
/* seek to start and try sampling some more */
|
||||||
|
stb_vorbis_seek_start(channel->context.vorbis.handle);
|
||||||
|
else
|
||||||
|
/* leave silence */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* panning and mixing */
|
/* panning and mixing */
|
||||||
|
|
||||||
#if AUDIO_N_CHANNELS == 2
|
#if AUDIO_N_CHANNELS == 2
|
||||||
|
Loading…
Reference in New Issue
Block a user