From 3decaeaf7a2076b8fb34ea5ddcd7d209fa6da153 Mon Sep 17 00:00:00 2001 From: avolkov Date: Sat, 20 Sep 2003 01:09:01 +0000 Subject: [PATCH] Video playback support phase 2 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1246 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/sound/stream.c | 17 +++++++++++++++++ sc2/src/sc2code/libs/sound/stream.h | 1 + 2 files changed, 18 insertions(+) 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);