From 7f5b5381101512467617be8da623633d94f5b80d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 25 Jun 2014 04:59:18 -0700 Subject: [PATCH] Implement SetPosition for OpenAL streams --- src/sound/oalsound.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 127233057..f1e3c9cfa 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -303,8 +303,21 @@ public: return (getALError()==AL_NO_ERROR); } + virtual bool SetPosition(unsigned int ms_pos) + { + if(!Decoder->seek(ms_pos)) + return false; + + alSourceStop(Source); + getALError(); + return true; + } + virtual unsigned int GetPosition() - { return 0; } + { + // FIXME: Decoder position - amount buffered + source offset + return 0; + } virtual bool IsEnded() {