From b298140b07842bd3573866564ad30ddfef65638c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 7 Sep 2018 21:58:46 +0200 Subject: demux: return stream file size differently, rip out stream ctrls The stream size return was the only thing that still required doing STREAM_CTRLs from frontend through the demuxer layer. This can be done much easier, so rip it out. Also rip out the now unused infrastructure for STREAM_CTRLs via demuxer layer. --- player/playloop.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 85cc9f7faf..0326e32779 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -519,11 +519,9 @@ double get_current_pos_ratio(struct MPContext *mpctx, bool use_range) if (len > 0) ans = MPCLAMP((pos - start) / len, 0, 1); if (ans < 0 || demuxer->ts_resets_possible) { - int64_t size; - if (demux_stream_control(demuxer, STREAM_CTRL_GET_SIZE, &size) > 0) { - if (size > 0 && demuxer->filepos >= 0) - ans = MPCLAMP(demuxer->filepos / (double)size, 0, 1); - } + int64_t size = demuxer->filesize; + if (size > 0 && demuxer->filepos >= 0) + ans = MPCLAMP(demuxer->filepos / (double)size, 0, 1); } if (use_range) { if (mpctx->opts->play_frames > 0) -- cgit v1.2.3