diff --git a/sc2/src/sc2code/libs/sound/stream.c b/sc2/src/sc2code/libs/sound/stream.c index 6cb32e89e..db81dec71 100644 --- a/sc2/src/sc2code/libs/sound/stream.c +++ b/sc2/src/sc2code/libs/sound/stream.c @@ -126,6 +126,23 @@ ResumeStream (uint32 source) TFBSound_SourcePlay (soundSource[source].handle); } +void +SeekStream (uint32 source, uint32 pos) +{ + TFB_SoundSample* sample = soundSource[source].sample; + bool looping; + bool scope; + + if (!sample) + return; + looping = sample->decoder->looping; + scope = soundSource[source].sbuffer != NULL; + + StopSource (source); + SoundDecoder_Seek (sample->decoder, pos); + PlayStream (sample, source, looping, scope, false); +} + BOOLEAN PlayingStream (uint32 source) { diff --git a/sc2/src/sc2code/libs/sound/stream.h b/sc2/src/sc2code/libs/sound/stream.h index 21f0e4530..a60e8d549 100644 --- a/sc2/src/sc2code/libs/sound/stream.h +++ b/sc2/src/sc2code/libs/sound/stream.h @@ -22,6 +22,7 @@ void PlayStream (TFB_SoundSample *sample, uint32 source, bool looping, void StopStream (uint32 source); void PauseStream (uint32 source); void ResumeStream (uint32 source); +void SeekStream (uint32 source, uint32 pos); BOOLEAN PlayingStream (uint32 source); int StreamDecoderTaskFunc (void *data); int PreDecodeClips (TFB_SoundSample *sample, TFB_SoundDecoder *decoders[], bool autofree);