History

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.

wm4 committed 6 years ago

Commit 26ec5861 parent aafc4341 file · +3 −0Browse files

Unified · Split

demux/demux.c+3−0
@@ -3078,6 +3078,9 @@ void demux_update(demuxer_t *demuxer, double pts) · 3077 unmodified lines
30783078 if (!in->threading)
30793079 update_cache(in);
30803080
3081+ // This implies this function is actually called from "the" user thread.
3082+ in->d_user->filesize = in->stream_size;
3083+
30813084 pts = MP_ADD_PTS(pts, -in->ts_offset);
30823085
30833086 struct timed_metadata *prev = lookup_timed_metadata(in, in->last_playback_pts);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t