From b5a220359b1347488846b074e34b59cd6dc818f5 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 2 Mar 2008 15:28:39 +0000 Subject: [PATCH] * Ogg codec fix regarding ogg files in pk3s (Tr3b) --- code/client/snd_codec_ogg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/client/snd_codec_ogg.c b/code/client/snd_codec_ogg.c index 98a56974..a4f1c774 100644 --- a/code/client/snd_codec_ogg.c +++ b/code/client/snd_codec_ogg.c @@ -198,15 +198,19 @@ int S_OGG_Callback_close(void *datasource) // ftell() replacement long S_OGG_Callback_tell(void *datasource) { + snd_stream_t *stream; + // check if input is valid if(!datasource) { - errno = EBADF; + errno = EBADF; return -1; } - // we keep track of the file position in stream->pos - return (long) (((snd_stream_t *) datasource) -> pos); + // snd_stream_t in the generic pointer + stream = (snd_stream_t *) datasource; + + return (long) FS_FTell(stream->file); } // the callback structure