summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 17:00:48 +0200
committerwm4 <wm4@nowhere>2014-07-05 17:07:15 +0200
commit4f00c7449119552bd88188a3c9d0ae6735db4d7e (patch)
tree66817d50fd64792d8ba4dc60b43cbc58f7b15ea8
parent54a4a25fe9d4504ba60fe40dc15744403a4680f9 (diff)
downloadmpv-4f00c7449119552bd88188a3c9d0ae6735db4d7e.tar.bz2
mpv-4f00c7449119552bd88188a3c9d0ae6735db4d7e.tar.xz
player: don't use stream position as fallback for percent-pos
This should be unneeded, and the packet position is already sufficient for this case. Accessing the stream position directly is going to be a problem when the stream is accessed from another thread later.
-rw-r--r--player/playloop.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 17df319879..e975e57413 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -461,9 +461,8 @@ double get_current_pos_ratio(struct MPContext *mpctx, bool use_range)
struct stream *s = demuxer->stream;
int64_t size;
if (stream_control(s, STREAM_CTRL_GET_SIZE, &size) > 0 && size > 0) {
- int64_t fpos =
- demuxer->filepos >= 0 ? demuxer->filepos : stream_tell(s);
- ans = MPCLAMP(fpos / (double)size, 0, 1);
+ if (demuxer->filepos >= 0)
+ ans = MPCLAMP(demuxer->filepos / (double)size, 0, 1);
}
}
if (use_range) {