summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/player/playloop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mpvcore/player/playloop.c b/mpvcore/player/playloop.c
index 8efb6d6693..9e5aa1e0b4 100644
--- a/mpvcore/player/playloop.c
+++ b/mpvcore/player/playloop.c
@@ -452,11 +452,12 @@ double get_current_pos_ratio(struct MPContext *mpctx, bool use_range)
if (len > 0 && !demuxer->ts_resets_possible) {
ans = MPCLAMP((pos - start) / len, 0, 1);
} else {
- int64_t size = (demuxer->movi_end - demuxer->movi_start);
+ struct stream *s = demuxer->stream;
+ int64_t size = s->end_pos - s->start_pos;
int64_t fpos = demuxer->filepos > 0 ?
demuxer->filepos : stream_tell(demuxer->stream);
if (size > 0)
- ans = MPCLAMP((double)(fpos - demuxer->movi_start) / size, 0, 1);
+ ans = MPCLAMP((double)(fpos - s->start_pos) / size, 0, 1);
}
if (use_range) {
if (mpctx->opts->play_frames > 0)