mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 03:52:22 +02:00
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.
This commit is contained in:
parent
54a4a25fe9
commit
4f00c74491
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user