summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 16:42:21 +0200
committerwm4 <wm4@nowhere>2014-07-05 17:07:14 +0200
commitbc29e17bcff58ceddca03c796f47e214b69f9cb2 (patch)
tree6bd4b6d47f5ee4dddc38bdc6b5c9a234ae2adabd
parent44d74991906e0a8c5598244f7d454c248108d99d (diff)
downloadmpv-bc29e17bcff58ceddca03c796f47e214b69f9cb2.tar.bz2
mpv-bc29e17bcff58ceddca03c796f47e214b69f9cb2.tar.xz
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.)
-rw-r--r--demux/demux_lavf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 42cffd23a9..d03cc0dc69 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -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)