From a4d487f5b2930611bf908243510d6f0351ebcf58 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 24 May 2014 14:04:09 +0200 Subject: 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. --- player/misc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'player/misc.c') diff --git a/player/misc.c b/player/misc.c index e3cf70f81e..6eae646242 100644 --- a/player/misc.c +++ b/player/misc.c @@ -169,14 +169,16 @@ void stream_dump(struct MPContext *mpctx) stream_t *stream = mpctx->stream; assert(stream && filename); + int64_t size = 0; + stream_control(stream, STREAM_CTRL_GET_SIZE, &size); + stream_set_capture_file(stream, filename); while (mpctx->stop_play == KEEP_PLAYING && !stream->eof) { if (!opts->quiet && ((stream->pos / (1024 * 1024)) % 2) == 1) { uint64_t pos = stream->pos; - uint64_t end = stream->end_pos; MP_MSG(mpctx, MSGL_STATUS, "Dumping %lld/%lld...", - (long long int)pos, (long long int)end); + (long long int)pos, (long long int)size); } stream_fill_buffer(stream); for (;;) { -- cgit v1.2.3