summaryrefslogtreecommitdiffhomepage
path: root/src/raudio.c
diff options
context:
space:
mode:
authorUneven Prankster <[email protected]>2021-09-23 12:38:37 -0300
committerGitHub <[email protected]>2021-09-23 17:38:37 +0200
commit7fa521fae4e64a4dcdca70a1ebd329a4ef63a643 (patch)
treefbfe5b211b1c797a6b3590a0f3805cd4a031da2e /src/raudio.c
parent08ea5e419eb327f0a2d2748970aa472f6bd6a947 (diff)
downloadraylib-7fa521fae4e64a4dcdca70a1ebd329a4ef63a643.tar.gz
raylib-7fa521fae4e64a4dcdca70a1ebd329a4ef63a643.zip
Fix + Return if attempting to seek on a module format (#2008)
Diffstat (limited to 'src/raudio.c')
-rw-r--r--src/raudio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/raudio.c b/src/raudio.c
index d05d1496..0de3a767 100644
--- a/src/raudio.c
+++ b/src/raudio.c
@@ -1659,6 +1659,9 @@ void StopMusicStream(Music music)
// Seek music to a certain position (in seconds)
void SeekMusicStream(Music music, float position)
{
+ // Seeking is not supported in module formats
+ if(music.ctxType == MUSIC_MODULE_XM || music.ctxType == MUSIC_MODULE_MOD) return;
+
unsigned int positionInFrames = (unsigned int)(position * music.stream.sampleRate);
switch (music.ctxType)
{
@@ -1676,6 +1679,7 @@ void SeekMusicStream(Music music, float position)
#endif
default: break;
}
+ music.stream.buffer->framesProcessed = positionInFrames;
}
// Update (re-fill) music buffers if data already processed