From d8922361d147bfdc91cd9a09160b025d832a6b72 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 7 Aug 2013 23:15:11 +0200 Subject: demux_lavf: blacklist "tty" libavformat demuxer This is completely useless, and in this particular case, it broke the fallback for MLP2 subtitles (stored as .txt files) to demux_subreader. (Yes, libavformat should be fixed to handle this, but for now this will _always_ break playback of subtitle files stored in .txt.) You can still force this demuxer, but by default we will just pretend that the "tty" demuxer does not exist. --- demux/demux_lavf.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'demux/demux_lavf.c') diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 9a148c4a1e..4a9d127974 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -105,6 +105,11 @@ static const struct format_hack format_hacks[] = { {0} }; +static const char *format_blacklist[] = { + "tty", // Useless non-sense, sometimes breaks MLP2 subreader.c fallback + 0 +}; + static const struct format_hack *find_format_from_mime_type(char *mime_type) { for (int n = 0; format_hacks[n].ff_name; n++) { @@ -303,9 +308,19 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check) av_free(avpd.buf); + if (priv->avif && !format) { + for (int n = 0; format_blacklist[n]; n++) { + if (strcmp(format_blacklist[n], priv->avif->name) == 0) { + mp_msg(MSGT_HEADER, MSGL_V, "Format blacklisted.\n"); + priv->avif = NULL; + break; + } + } + } + if (!priv->avif) { mp_msg(MSGT_HEADER, MSGL_V, - "No format found, try lowering probescore.\n"); + "No format found, try lowering probescore or forcing the format.\n"); return -1; } -- cgit v1.2.3