diff options
author | wm4 <wm4@nowhere> | 2013-08-07 23:15:11 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-08-07 23:15:43 +0200 |
commit | d8922361d147bfdc91cd9a09160b025d832a6b72 (patch) | |
tree | 87b56103317656807c9480e48b33c9776822b788 /demux/demux_lavf.c | |
parent | 182b47056776622473ca86a1a4f8c13e1ca6bf34 (diff) | |
download | mpv-d8922361d147bfdc91cd9a09160b025d832a6b72.tar.bz2 mpv-d8922361d147bfdc91cd9a09160b025d832a6b72.tar.xz |
demux_lavf: blacklist "tty" libavformat demuxerv0.1.0
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.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 17 |
1 files changed, 16 insertions, 1 deletions
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; } |