mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-18 02:50:33 +00: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;
|
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
|
Stream_OpenMPG
|
||||||
@ -138,7 +148,7 @@ stream_t *Stream_OpenMPG( const char *filename )
|
|||||||
if( ret ) Con_DPrintf( S_ERROR "%s\n", get_error( mpeg ));
|
if( ret ) Con_DPrintf( S_ERROR "%s\n", get_error( mpeg ));
|
||||||
|
|
||||||
// trying to open stream and read header
|
// 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 ));
|
Con_DPrintf( S_ERROR "Stream_OpenMPG: failed to load (%s): %s\n", filename, get_error( mpeg ));
|
||||||
close_decoder( mpeg );
|
close_decoder( mpeg );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user