diff options
author | wm4 <wm4@nowhere> | 2020-02-16 23:59:21 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-02-16 23:59:21 +0100 |
commit | 26ec5862b3edff2d41726fec0619cdee07967b67 (patch) | |
tree | f7b6c2fb6a71f8c018c1c4e67d73caceef78de2d | |
parent | aafc434f00b339fa7f15e6114311da0fcc5e3269 (diff) | |
download | mpv-26ec5862b3edff2d41726fec0619cdee07967b67.tar.bz2 mpv-26ec5862b3edff2d41726fec0619cdee07967b67.tar.xz |
demux: update file-size property even when paused
While paused, the decoders typically stop reading data from the demuxer.
But for some reason, the file size is returned as a public field in
struct demuxer (wat...), and updated only when the packet reading
function is called. This caused the file size property to always return
the same value when paused, even though the demuxer thread was reading
new data, and the internal file size was updated.
Fix with a simple hack.
-rw-r--r-- | demux/demux.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c index 8360b9069f..f6c7679220 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -3078,6 +3078,9 @@ void demux_update(demuxer_t *demuxer, double pts) if (!in->threading) update_cache(in); + // This implies this function is actually called from "the" user thread. + in->d_user->filesize = in->stream_size; + pts = MP_ADD_PTS(pts, -in->ts_offset); struct timed_metadata *prev = lookup_timed_metadata(in, in->last_playback_pts); |