mirror of https://github.com/mpv-player/mpv
demux_lavf: fix read_seek return value
This returned a stream error value directly to libavformat, which can't make sense. For example STREAM_ERROR (0) means success in libavformat error codes. (The meaning of the libavformat read_seek return value is underdocumented too.)
This commit is contained in:
parent
44d7499190
commit
bc29e17bcf
|
@ -187,9 +187,7 @@ static int64_t mp_read_seek(void *opaque, int stream_idx, int64_t ts, int flags)
|
|||
AVStream *st = priv->avfc->streams[stream_idx];
|
||||
double pts = (double)ts * st->time_base.num / st->time_base.den;
|
||||
int ret = stream_control(stream, STREAM_CTRL_SEEK_TO_TIME, &pts);
|
||||
if (ret < 0)
|
||||
ret = AVERROR(ENOSYS);
|
||||
return ret;
|
||||
return ret < 1 ? AVERROR(ENOSYS) : 0;
|
||||
}
|
||||
|
||||
static void list_formats(struct demuxer *demuxer)
|
||||
|
|
Loading…
Reference in New Issue