summaryrefslogtreecommitdiffstats
path: root/stream/cache.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-30 22:46:25 +0100
committerwm4 <wm4@nowhere>2014-10-30 22:46:36 +0100
commita77a171b7ff436cb63b13321427a259a2a8c8fc7 (patch)
tree67597e78bded0eb1e4a77edaa82ed86a772e0456 /stream/cache.c
parent56b852710ad0b6b1466427549db0792ee67318aa (diff)
downloadmpv-a77a171b7ff436cb63b13321427a259a2a8c8fc7.tar.bz2
mpv-a77a171b7ff436cb63b13321427a259a2a8c8fc7.tar.xz
demux_lavf: mark as seekable if protocol supports seeking by time
Basically, this will mark the demuxer as seekable with rtmp* and mmsh protocols. These protocols have network-level time seeking, and whether you can seek on the byte level does not matter. Until now, seeking was typically only enabled because of the cache, and a (nonsensical) warning was shown accordingly. It still could happen that the server doesn't actually support thse requests (or simply rejects them), so this is somewhat imperfect.
Diffstat (limited to 'stream/cache.c')
-rw-r--r--stream/cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stream/cache.c b/stream/cache.c
index bc4d9e2610..7bbbcd62c5 100644
--- a/stream/cache.c
+++ b/stream/cache.c
@@ -112,6 +112,7 @@ struct priv {
int64_t stream_size;
struct mp_tags *stream_metadata;
double start_pts;
+ bool has_avseek;
};
enum {
@@ -361,6 +362,7 @@ static void update_cached_controls(struct priv *s)
s->stream_size = -1;
if (stream_control(s->stream, STREAM_CTRL_GET_SIZE, &i64) == STREAM_OK)
s->stream_size = i64;
+ s->has_avseek = stream_control(s->stream, STREAM_CTRL_HAS_AVSEEK, NULL) > 0;
}
// the core might call these every frame, so cache them...
@@ -391,6 +393,8 @@ static int cache_get_cached_control(stream_t *cache, int cmd, void *arg)
*(double *)arg = s->start_pts;
return STREAM_OK;
}
+ case STREAM_CTRL_HAS_AVSEEK:
+ return s->has_avseek ? STREAM_OK : STREAM_UNSUPPORTED;
case STREAM_CTRL_GET_METADATA: {
if (s->stream_metadata) {
ta_set_parent(s->stream_metadata, NULL);