mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 00:42:57 +00:00
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.
This commit is contained in:
parent
182b470567
commit
d8922361d1
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user