Browse Source

filesystem: fix lseek for mpg123

pull/2/head
MoeMod Server #2 2 years ago committed by Alibek Omarov
parent
commit
499cd48e83
  1. 12
      engine/common/soundlib/snd_mp3.c

12
engine/common/soundlib/snd_mp3.c

@ -105,6 +105,16 @@ qboolean Sound_LoadMPG( const char *name, const byte *buffer, fs_offset_t filesi @@ -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 ) @@ -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…
Cancel
Save