Read callback used to implement a custom stream. The semantics of the
callback match read(2) in blocking mode. Short reads are allowed (you can
return less bytes than requested, and libmpv will retry reading the rest
with another call). If no data can be immediately read, the callback must
block until there is new data. A return of 0 will be interpreted as final
EOF, although libmpv might retry the read, or seek to a different position.
@param cookie opaque cookie identifying the stream,
returned from mpv_stream_cb_open_fn
@param buf buffer to read data into
@param size of the buffer
@return number of bytes read into the buffer
@return 0 on EOF
@return -1 on error
Read callback used to implement a custom stream. The semantics of the callback match read(2) in blocking mode. Short reads are allowed (you can return less bytes than requested, and libmpv will retry reading the rest with another call). If no data can be immediately read, the callback must block until there is new data. A return of 0 will be interpreted as final EOF, although libmpv might retry the read, or seek to a different position.
@param cookie opaque cookie identifying the stream, returned from mpv_stream_cb_open_fn @param buf buffer to read data into @param size of the buffer @return number of bytes read into the buffer @return 0 on EOF @return -1 on error