mirror of
https://github.com/ioquake/ioq3.git
synced 2025-05-29 16:11:31 +00:00
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.
This commit is contained in:
parent
c69db4a400
commit
2d45e57068
3 changed files with 40 additions and 17 deletions
|
@ -157,11 +157,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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue