summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-18 21:10:43 +0100
committerwm4 <wm4@nowhere>2015-02-18 21:12:57 +0100
commit102946ee0358924f22477435114785bd1f901ade (patch)
tree041231408c3ae32bee50902f700d68dd4fea55eb /demux/demux_lavf.c
parent37a0c9140ad85be8d184b626759f8d24ca69aa83 (diff)
downloadmpv-102946ee0358924f22477435114785bd1f901ade.tar.bz2
mpv-102946ee0358924f22477435114785bd1f901ade.tar.xz
player: enable cache and demuxer thread for subtitles too
Includes some logic for not starting the demuxer thread for fully read subtitles. (Well, the cache will still waste _lots_ of resources, and the cache always has to be created, because we don't know whether it'll be needed _before_ opening the file.) See #1597.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 98cb4df5e6..ca7004c43b 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -103,12 +103,14 @@ struct format_hack {
bool ignore : 1; // blacklisted
bool no_stream : 1; // do not wrap struct stream as AVIOContext
bool use_stream_ids : 1; // export the native stream IDs
+ bool fully_read : 1; // set demuxer.fully_read flag
// Do not confuse player's position estimation (position is into external
// segment, with e.g. HLS, player knows about the playlist main file only).
bool clear_filepos : 1;
};
#define BLACKLIST(fmt) {fmt, .ignore = true}
+#define TEXTSUB(fmt) {fmt, .fully_read = true}
static const struct format_hack format_hacks[] = {
// for webradios
@@ -123,6 +125,11 @@ static const struct format_hack format_hacks[] = {
{"mpeg", .use_stream_ids = true},
{"mpegts", .use_stream_ids = true},
+ TEXTSUB("aqtitle"), TEXTSUB("ass"), TEXTSUB("jacosub"), TEXTSUB("microdvd"),
+ TEXTSUB("mpl2"), TEXTSUB("mpsub"), TEXTSUB("pjs"), TEXTSUB("realtext"),
+ TEXTSUB("sami"), TEXTSUB("srt"), TEXTSUB("stl"), TEXTSUB("subviewer"),
+ TEXTSUB("subviewer1"), TEXTSUB("vplayer"), TEXTSUB("webvtt"),
+
// Useless non-sense, sometimes breaks MLP2 subreader.c fallback
BLACKLIST("tty"),
// Image demuxers, disabled in favor of demux_mf (for now):
@@ -815,6 +822,7 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
0 : (double)priv->avfc->start_time / AV_TIME_BASE;
demuxer->allow_refresh_seeks = matches_avinputformat_name(priv, "mp4");
+ demuxer->fully_read = priv->format_hack.fully_read;
return 0;
}