sub: add name field to all sub decoders

Might help with debugging.
This commit is contained in:
wm4 2013-06-03 21:49:39 +02:00
parent 3289be9a28
commit 61dfe12179
9 changed files with 20 additions and 0 deletions

View File

@ -115,6 +115,17 @@ void sub_set_ass_renderer(struct dec_sub *sub, struct ass_library *ass_library,
sub->init_sd.ass_renderer = ass_renderer;
}
static void print_chain(struct dec_sub *sub)
{
mp_msg(MSGT_OSD, MSGL_V, "Subtitle filter chain: ");
for (int n = 0; n < sub->num_sd; n++) {
struct sd *sd = sub->sd[n];
mp_msg(MSGT_OSD, MSGL_V, "%s%s (%s)", n > 0 ? " -> " : "",
sd->driver->name, sd->codec);
}
mp_msg(MSGT_OSD, MSGL_V, "\n");
}
// Subtitles read with subreader.c
static void read_sub_data(struct dec_sub *sub, struct sub_data *subdata)
{
@ -218,6 +229,7 @@ void sub_init_from_sh(struct dec_sub *sub, struct sh_sub *sh)
sub->num_sd++;
// Try adding new converters until a decoder is reached
if (sd->driver->get_bitmaps || sd->driver->get_text) {
print_chain(sub);
if (sh->sub_data)
read_sub_data(sub, sh->sub_data);
return;

View File

@ -45,6 +45,7 @@ struct sd {
};
struct sd_functions {
const char *name;
bool accept_packets_in_advance;
bool (*supports_format)(const char *format);
int (*init)(struct sd *sd);

View File

@ -300,6 +300,7 @@ static void uninit(struct sd *sd)
}
const struct sd_functions sd_ass = {
.name = "ass",
.accept_packets_in_advance = true,
.supports_format = supports_format,
.init = init,

View File

@ -244,6 +244,7 @@ static void uninit(struct sd *sd)
}
const struct sd_functions sd_lavc = {
.name = "lavc",
.supports_format = supports_format,
.init = init,
.decode = decode,

View File

@ -155,6 +155,7 @@ static void uninit(struct sd *sd)
}
const struct sd_functions sd_lavc_conv = {
.name = "lavc_conv",
.supports_format = supports_format,
.init = init,
.decode = decode,

View File

@ -329,6 +329,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
}
const struct sd_functions sd_microdvd = {
.name = "microdvd",
.supports_format = supports_format,
.init = init,
.decode = decode,

View File

@ -46,6 +46,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
}
const struct sd_functions sd_movtext = {
.name = "movtext",
.supports_format = supports_format,
.init = init,
.decode = decode,

View File

@ -92,6 +92,7 @@ static void uninit(struct sd *sd)
}
const struct sd_functions sd_spu = {
.name = "spu",
.supports_format = supports_format,
.init = init,
.decode = decode,

View File

@ -458,6 +458,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
}
const struct sd_functions sd_srt = {
.name = "srt",
.supports_format = supports_format,
.init = init,
.decode = decode,