[][src]Type Definition libmpv_sys::mpv_stream_cb_seek_fn

type mpv_stream_cb_seek_fn = Option<unsafe extern "C" fn(cookie: *mut c_void, offset: i64) -> i64>;

Seek callback used to implement a custom stream.

Note that mpv will issue a seek to position 0 immediately after opening. This is used to test whether the stream is seekable (since seekability might depend on the URI contents, not just the protocol). Return MPV_ERROR_UNSUPPORTED if seeking is not implemented for this stream. This seek also serves to establish the fact that streams start at position 0.

This callback can be NULL, in which it behaves as if always returning MPV_ERROR_UNSUPPORTED.

@param cookie opaque cookie identifying the stream, returned from mpv_stream_cb_open_fn @param offset target absolut stream position @return the resulting offset of the stream MPV_ERROR_UNSUPPORTED or MPV_ERROR_GENERIC if the seek failed