浏览代码

Fix + Return if attempting to seek on a module format (#2008)

pull/2010/head
Uneven Prankster 3 年前
committed by GitHub
父节点
当前提交
7fa521fae4
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      src/raudio.c

+ 4
- 0
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

正在加载...
取消
保存