Return AVERROR_EOF in case of EOF to prevent game freeze
This commit is contained in:
@@ -384,7 +384,10 @@ static RString averr_ssprintf( int err, const char *fmt, ... )
|
|||||||
static int AVIORageFile_ReadPacket( void *opaque, uint8_t *buf, int buf_size )
|
static int AVIORageFile_ReadPacket( void *opaque, uint8_t *buf, int buf_size )
|
||||||
{
|
{
|
||||||
RageFile *f = (RageFile *)opaque;
|
RageFile *f = (RageFile *)opaque;
|
||||||
return f->Read( buf, buf_size );
|
int n = f->Read( buf, buf_size );
|
||||||
|
if (n == 0)
|
||||||
|
return AVERROR_EOF;
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t AVIORageFile_Seek( void *opaque, int64_t offset, int whence )
|
static int64_t AVIORageFile_Seek( void *opaque, int64_t offset, int whence )
|
||||||
|
|||||||
Reference in New Issue
Block a user