REVIEWED: SeekMusicStream() formating
This commit is contained in:
parent
7fa521fae4
commit
ddc1fdf6d5
1 changed files with 4 additions and 2 deletions
|
@ -1660,9 +1660,10 @@ void StopMusicStream(Music music)
|
||||||
void SeekMusicStream(Music music, float position)
|
void SeekMusicStream(Music music, float position)
|
||||||
{
|
{
|
||||||
// Seeking is not supported in module formats
|
// Seeking is not supported in module formats
|
||||||
if(music.ctxType == MUSIC_MODULE_XM || music.ctxType == MUSIC_MODULE_MOD) return;
|
if ((music.ctxType == MUSIC_MODULE_XM) || (music.ctxType == MUSIC_MODULE_MOD)) return;
|
||||||
|
|
||||||
|
unsigned int positionInFrames = (unsigned int)(position*music.stream.sampleRate);
|
||||||
|
|
||||||
unsigned int positionInFrames = (unsigned int)(position * music.stream.sampleRate);
|
|
||||||
switch (music.ctxType)
|
switch (music.ctxType)
|
||||||
{
|
{
|
||||||
#if defined(SUPPORT_FILEFORMAT_WAV)
|
#if defined(SUPPORT_FILEFORMAT_WAV)
|
||||||
|
@ -1679,6 +1680,7 @@ void SeekMusicStream(Music music, float position)
|
||||||
#endif
|
#endif
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
music.stream.buffer->framesProcessed = positionInFrames;
|
music.stream.buffer->framesProcessed = positionInFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue