Skip to content

Commit

Permalink
demux_lavf: blacklist "tty" libavformat demuxer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wm4 committed Aug 7, 2013
1 parent 182b470 commit d892236
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion demux/demux_lavf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d892236

Please sign in to comment.