diff options
author | wm4 <wm4@nowhere> | 2014-07-05 17:00:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-05 17:07:15 +0200 |
commit | 4f00c7449119552bd88188a3c9d0ae6735db4d7e (patch) | |
tree | 66817d50fd64792d8ba4dc60b43cbc58f7b15ea8 /player | |
parent | 54a4a25fe9d4504ba60fe40dc15744403a4680f9 (diff) |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/playloop.c | 5 |
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) { |