sub: refactor initialization

Just simplify by removing parts not needed anymore. This includes
merging dec_sub allocation and initialization (since things making
initialization complicated were removed), or format support queries (it
simply tries to create a decoder, and if that fails, tries the next
one).
This commit is contained in:
wm4
2015-12-27 02:07:01 +01:00
parent 50c379e2d8
commit d85753b79e
7 changed files with 88 additions and 153 deletions

View File

@@ -125,12 +125,6 @@ static void add_subtitle_fonts(struct sd *sd)
}
}
static bool supports_format(const char *format)
{
return (format && strcmp(format, "ass") == 0) ||
lavc_conv_supports_format(format);
}
static void enable_output(struct sd *sd, bool enable)
{
struct sd_ass_priv *ctx = sd->priv;
@@ -633,7 +627,6 @@ static int control(struct sd *sd, enum sd_ctrl cmd, void *arg)
const struct sd_functions sd_ass = {
.name = "ass",
.accept_packets_in_advance = true,
.supports_format = supports_format,
.init = init,
.decode = decode,
.get_bitmaps = get_bitmaps,