diff options
author | wm4 <wm4@nowhere> | 2014-05-24 14:04:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-24 16:17:51 +0200 |
commit | a4d487f5b2930611bf908243510d6f0351ebcf58 (patch) | |
tree | 000fc31412c31ea60ef0b7c59af087e6402b4541 /demux/demux.c | |
parent | e3c20bf3505679641f247471603ad298d04036bd (diff) | |
download | mpv-a4d487f5b2930611bf908243510d6f0351ebcf58.tar.bz2 mpv-a4d487f5b2930611bf908243510d6f0351ebcf58.tar.xz |
stream: don't use end_pos
Stop using it in most places, and prefer STREAM_CTRL_GET_SIZE. The
advantage is that always the correct size will be used. There can be no
doubt anymore whether the end_pos value is outdated (as it happens often
with files that are being downloaded).
Some streams still use end_pos. They don't change size, and it's easier
to emulate STREAM_CTRL_GET_SIZE using end_pos, instead of adding a
STREAM_CTRL_GET_SIZE implementation to these streams.
Make sure int64_t is always used for STREAM_CTRL_GET_SIZE (it was
uint64_t before).
Remove the seek flags mess, and replace them with a seekable flag. Every
stream must set it consistently now, and an assertion in stream.c checks
this. Don't distinguish between streams that can only be forward or
backwards seeked, since we have no such stream types.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/demux/demux.c b/demux/demux.c index 4da1adb134..ba231b5af6 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -587,8 +587,7 @@ static struct demuxer *open_given_type(struct mpv_global *global, .type = desc->type, .stream = stream, .stream_pts = MP_NOPTS_VALUE, - .seekable = (stream->flags & MP_STREAM_SEEK) == MP_STREAM_SEEK && - stream->end_pos > 0, + .seekable = stream->seekable, .accurate_seek = true, .filepos = -1, .opts = global->opts, |