diff options
author | wm4 <wm4@nowhere> | 2018-09-07 23:02:36 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:04 +0200 |
commit | 5114c69c7f85e7cd38d6928e874c5b44c951be60 (patch) | |
tree | 7aacce1ca7905545cba48c2604071d62bd434135 /demux/demux.h | |
parent | b1c202c12fdd2b53f49e7a9ca5c2f4b84733f511 (diff) | |
download | mpv-5114c69c7f85e7cd38d6928e874c5b44c951be60.tar.bz2 mpv-5114c69c7f85e7cd38d6928e874c5b44c951be60.tar.xz |
demux: change hack for closing subtitle files early
Subtitles (and a few other file types, like playlists) are not streamed,
but fully read on opening. This means keeping the file handle or network
socket open is a waste of resources and could cause other weird
behavior. This is why there's a hack to close them after opening.
Change this hack to make the demuxer itself do this, which is less
weird. (Until recently, demuxer->stream ownership was more complex,
which is why it was done this way.)
There is some evil shit due to a huge ownership/lifetime mess of various
objects. Especially EDL (the currently only nested demuxer case)
requires being careful about mp_cancel and passing down stream pointers.
As one defensive programming measure, stop accessing the "stream"
variable in open_given_type(), even where it would still work. This
includes removing a redundant line of code, and removing the peak call,
which should not be needed anymore, as the remaining demuxers do this
mostly correctly.
Diffstat (limited to 'demux/demux.h')
-rw-r--r-- | demux/demux.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/demux/demux.h b/demux/demux.h index 2c089be823..ed013a043c 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -32,7 +32,6 @@ enum demux_ctrl { DEMUXER_CTRL_SWITCHED_TRACKS = 1, - DEMUXER_CTRL_REPLACE_STREAM, }; #define MAX_SEEK_RANGES 10 @@ -295,6 +294,7 @@ int demuxer_add_chapter(demuxer_t *demuxer, char *name, double pts, uint64_t demuxer_id); void demux_set_stream_tags(struct demuxer *demuxer, struct sh_stream *sh, struct mp_tags *tags); +void demux_close_stream(struct demuxer *demuxer); void demux_metadata_changed(demuxer_t *demuxer); void demux_update(demuxer_t *demuxer); |