From 4f00c7449119552bd88188a3c9d0ae6735db4d7e Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 5 Jul 2014 17:00:48 +0200 Subject: 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. --- player/playloop.c | 5 ++--- 1 file 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) { -- cgit v1.2.3