From 9196ebd50b8241285323297f58cd95b0f0c916f4 Mon Sep 17 00:00:00 2001 From: rude Date: Thu, 20 Aug 2009 21:14:06 +0200 Subject: [PATCH] Looping now works for OGG and tracker files (only tested with XM). --- src/modules/sound/lullaby/ModPlugDecoder.cpp | 7 +++++-- src/modules/sound/lullaby/VorbisDecoder.h | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/sound/lullaby/ModPlugDecoder.cpp b/src/modules/sound/lullaby/ModPlugDecoder.cpp index 2dabd6e9a..8b475dc0c 100644 --- a/src/modules/sound/lullaby/ModPlugDecoder.cpp +++ b/src/modules/sound/lullaby/ModPlugDecoder.cpp @@ -93,8 +93,11 @@ namespace lullaby bool ModPlugDecoder::rewind() { - ModPlug_Seek(plug, 0); - return true; + // Let's reload. + ModPlug_Unload(plug); + plug = ModPlug_Load(data->getData(), data->getSize()); + eof = false; + return (plug != 0); } bool ModPlugDecoder::isSeekable() diff --git a/src/modules/sound/lullaby/VorbisDecoder.h b/src/modules/sound/lullaby/VorbisDecoder.h index 2ea1a3b4b..ab4421d61 100644 --- a/src/modules/sound/lullaby/VorbisDecoder.h +++ b/src/modules/sound/lullaby/VorbisDecoder.h @@ -51,7 +51,6 @@ namespace lullaby OggVorbis_File handle; // Handle to the file vorbis_info * vorbisInfo; // Info vorbis_comment * vorbisComment; // Comments - bool eof; // Whether we have reached the end of the file public: