From f0d9b3b14317b77f66ce9c92e273ffe6cf482bc9 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Sat, 16 Aug 2008 22:46:41 +0000 Subject: [PATCH] Loading voices now works properly also when ogg support is disabled. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3036 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/sound/decoders/decoder.c | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sc2/src/sc2code/libs/sound/decoders/decoder.c b/sc2/src/sc2code/libs/sound/decoders/decoder.c index a984821ae..f1d3f59b1 100644 --- a/sc2/src/sc2code/libs/sound/decoders/decoder.c +++ b/sc2/src/sc2code/libs/sound/decoders/decoder.c @@ -344,10 +344,23 @@ SoundDecoder_Load (uio_DirHandle *dir, char *filename, if (!info->ext) { log_add (log_Warning, "SoundDecoder_Load(): Unsupported file type (%s)", - filename); - return NULL; + filename); + + if (runTime) + { + runTime = abs (runTime); + startTime = 0; + funcs = &nula_DecoderVtbl; + } + else + { + return NULL; + } + } + else + { + funcs = info->funcs; } - funcs = info->funcs; if (!fileExists2 (dir, filename)) { @@ -365,7 +378,7 @@ SoundDecoder_Load (uio_DirHandle *dir, char *filename, } } - struct_size = info->funcs->GetStructSize (); + struct_size = funcs->GetStructSize (); if (struct_size < SD_MIN_SIZE) struct_size = SD_MIN_SIZE;