Closed sezero closed 2 years ago
Interesting... Usually the seek doesn't fail until the out-of-range value has been requested, or disk failed for any reason (like, got been disconnected or unmounted for any unexpected error, etc.). Normally I never met any seek errors, but could try...
EDIT: Yes, I confirm this (what going at Vorbis itself):
static int _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
if(vf->datasource){
/* only seek if the file position isn't already there */
if(vf->offset != offset){
if(!(vf->callbacks.seek_func)||
(vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET) == -1) // <--------------------
return OV_EREAD;
vf->offset=offset;
ogg_sync_reset(&vf->oy);
}
}else{
/* shouldn't happen unless someone writes a broken callback */
return OV_EFAULT;
}
return 0;
}
SDL_RWseek(), in both SDL-1.2 and SDL-2.0, returns the current offset upon success and not NOERROR (0), therefore it behaves like
lseek
, notfseek
which vorbis expects. The current version seems to have worked so far by luck.CC: @Wohlstand