mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-26 11:49:25 +01:00
filesystem: fix lseek for mpg123
This commit is contained in:
parent
444e08f59a
commit
499cd48e83
@ -105,6 +105,16 @@ qboolean Sound_LoadMPG( const char *name, const byte *buffer, fs_offset_t filesi
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
FS_SeekEx
|
||||
=================
|
||||
*/
|
||||
fs_offset_t FS_SeekEx( file_t *file, fs_offset_t offset, int whence )
|
||||
{
|
||||
return FS_Seek( file, offset, whence ) == -1 ? -1 : FS_Tell( file );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Stream_OpenMPG
|
||||
@ -138,7 +148,7 @@ stream_t *Stream_OpenMPG( const char *filename )
|
||||
if( ret ) Con_DPrintf( S_ERROR "%s\n", get_error( mpeg ));
|
||||
|
||||
// trying to open stream and read header
|
||||
if( !open_mpeg_stream( mpeg, file, (void*)FS_Read, (void*)FS_Seek, &sc ))
|
||||
if( !open_mpeg_stream( mpeg, file, (void*)FS_Read, (void*)FS_SeekEx, &sc ))
|
||||
{
|
||||
Con_DPrintf( S_ERROR "Stream_OpenMPG: failed to load (%s): %s\n", filename, get_error( mpeg ));
|
||||
close_decoder( mpeg );
|
||||
|
Loading…
Reference in New Issue
Block a user