diff options
author | Zack Middleton <zturtleman@gmail.com> | 2013-10-26 22:43:53 -0500 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-06-17 17:43:36 +0100 |
commit | 00ca06739540e43b2f885c54ef18aeb9564fe68c (patch) | |
tree | 38933c208302f03fdb46ce7861ee6c1c69d8cca9 /src/client | |
parent | b7b38443f2e53aa152776a15f1a67afdc0bfaf1c (diff) |
Support FS_SEEK_END and negative offset for zipped files in FS_Seek
Use FS_SEEK_END in sound code instead of working around it.
If FS_SEEK_SET and going to current position, just return.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/snd_codec_ogg.c | 5 | ||||
-rw-r--r-- | src/client/snd_codec_opus.c | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/client/snd_codec_ogg.c b/src/client/snd_codec_ogg.c index 882bfcb4..eb187be9 100644 --- a/src/client/snd_codec_ogg.c +++ b/src/client/snd_codec_ogg.c @@ -158,11 +158,8 @@ int S_OGG_Callback_seek(void *datasource, ogg_int64_t offset, int whence) case SEEK_END : { - // Quake 3 seems to have trouble with FS_SEEK_END - // so we use the file length and FS_SEEK_SET - // set the file position in the actual file with the Q3 function - retVal = FS_Seek(stream->file, (long) stream->length + (long) offset, FS_SEEK_SET); + retVal = FS_Seek(stream->file, (long) offset, FS_SEEK_END); // something has gone wrong, so we return here if(retVal < 0) diff --git a/src/client/snd_codec_opus.c b/src/client/snd_codec_opus.c index 190aee9a..b43dea44 100644 --- a/src/client/snd_codec_opus.c +++ b/src/client/snd_codec_opus.c @@ -146,11 +146,8 @@ int S_OggOpus_Callback_seek(void *datasource, opus_int64 offset, int whence) case SEEK_END : { - // Quake 3 seems to have trouble with FS_SEEK_END - // so we use the file length and FS_SEEK_SET - // set the file position in the actual file with the Q3 function - retVal = FS_Seek(stream->file, (long) stream->length + (long) offset, FS_SEEK_SET); + retVal = FS_Seek(stream->file, (long) offset, FS_SEEK_END); // something has gone wrong, so we return here if(retVal < 0) |