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.
Unified · Split
| @@ -3078,6 +3078,9 @@ void demux_update(demuxer_t *demuxer, double pts) · 3077 unmodified lines | |||
| 3078 | if (!in->threading) | 3078 | if (!in->threading) |
| 3079 | update_cache(in); | 3079 | update_cache(in); |
| 3080 | 3080 | ||
| 3081 | // This implies this function is actually called from "the" user thread. | ||
| 3082 | in->d_user->filesize = in->stream_size; | ||
| 3083 | |||
| 3081 | pts = MP_ADD_PTS(pts, -in->ts_offset); | 3084 | pts = MP_ADD_PTS(pts, -in->ts_offset); |
| 3082 | 3085 | ||
| 3083 | struct timed_metadata *prev = lookup_timed_metadata(in, in->last_playback_pts); | 3086 | struct timed_metadata *prev = lookup_timed_metadata(in, in->last_playback_pts); |