sd_lavc_conv: don't check AV_CODEC_PROP_TEXT_SUB flag

Not actually useful. This would break whenever a new text subtitle
format would be added, which requires a binary->text transformation.
(mov_text is one such format; disable it.) In general, we would have
to know which packet formats are binary, which we don't, so the only
reasonable way to handle this is a white list.
This commit is contained in:
wm4
2013-08-15 23:24:53 +02:00
parent 3e6ed76935
commit 8b245c4d4b
2 changed files with 3 additions and 18 deletions

View File

@@ -40,20 +40,16 @@ static bool supports_format(const char *format)
const AVCodecDescriptor *desc = avcodec_descriptor_get(cid);
if (!desc)
return false;
#if HAVE_AV_CODEC_PROP_TEXT_SUB
// These are documented to support AVSubtitleRect->ass.
return desc->props & AV_CODEC_PROP_TEXT_SUB;
#else
// These are known to support AVSubtitleRect->ass.
const char *whitelist[] =
{"text", "ass", "ssa", "mov_text", "srt", "subrip", "microdvd", "mpl2",
"jacosub", "pjs", "sami", "realtext", "subviewer", "subviewer1",
{"text", "ass", "ssa", "srt", "subrip", "microdvd", "mpl2",
"jacosub", "pjs", "sami", "realtext", "subviewer", "subviewer1",
"vplayer", "webvtt", 0};
for (int n = 0; whitelist[n]; n++) {
if (strcmp(format, whitelist[n]) == 0)
return true;
}
return false;
#endif
}
// Disable style definitions generated by the libavcodec converter.