From 102946ee0358924f22477435114785bd1f901ade Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Feb 2015 21:10:43 +0100 Subject: 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. --- demux/demux_lavf.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'demux/demux_lavf.c') 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; } -- cgit v1.2.3