static int64_t fa_libav_seek(void *opaque, int64_t offset, int whence) { fa_handle_t *fh = opaque; if(whence == AVSEEK_SIZE) return fa_fsize(fh); int lazy = !(whence & AVSEEK_FORCE); return fa_seek4(fh, offset, whence & ~AVSEEK_FORCE, lazy); }
static int64_t cmp_seek(fa_handle_t *handle, int64_t pos, int whence, int lazy) { cmp_t *s = (cmp_t *)handle; int64_t r1 = fa_seek4(s->s_src, pos, whence, lazy); int64_t r2 = lseek(s->s_fd, pos, whence); if(r1 != r2) { TRACE(TRACE_ERROR, "FACMP", "seek(%"PRId64", %d) failed fa:%"PRId64" local:%"PRId64, pos, whence, r1, r2); exit(1); } return r1; }