mirror of https://github.com/mpv-player/mpv
sub: add name field to all sub decoders
Might help with debugging.
This commit is contained in:
parent
3289be9a28
commit
61dfe12179
|
@ -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;
|
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
|
// Subtitles read with subreader.c
|
||||||
static void read_sub_data(struct dec_sub *sub, struct sub_data *subdata)
|
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++;
|
sub->num_sd++;
|
||||||
// Try adding new converters until a decoder is reached
|
// Try adding new converters until a decoder is reached
|
||||||
if (sd->driver->get_bitmaps || sd->driver->get_text) {
|
if (sd->driver->get_bitmaps || sd->driver->get_text) {
|
||||||
|
print_chain(sub);
|
||||||
if (sh->sub_data)
|
if (sh->sub_data)
|
||||||
read_sub_data(sub, sh->sub_data);
|
read_sub_data(sub, sh->sub_data);
|
||||||
return;
|
return;
|
||||||
|
|
1
sub/sd.h
1
sub/sd.h
|
@ -45,6 +45,7 @@ struct sd {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sd_functions {
|
struct sd_functions {
|
||||||
|
const char *name;
|
||||||
bool accept_packets_in_advance;
|
bool accept_packets_in_advance;
|
||||||
bool (*supports_format)(const char *format);
|
bool (*supports_format)(const char *format);
|
||||||
int (*init)(struct sd *sd);
|
int (*init)(struct sd *sd);
|
||||||
|
|
|
@ -300,6 +300,7 @@ static void uninit(struct sd *sd)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct sd_functions sd_ass = {
|
const struct sd_functions sd_ass = {
|
||||||
|
.name = "ass",
|
||||||
.accept_packets_in_advance = true,
|
.accept_packets_in_advance = true,
|
||||||
.supports_format = supports_format,
|
.supports_format = supports_format,
|
||||||
.init = init,
|
.init = init,
|
||||||
|
|
|
@ -244,6 +244,7 @@ static void uninit(struct sd *sd)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct sd_functions sd_lavc = {
|
const struct sd_functions sd_lavc = {
|
||||||
|
.name = "lavc",
|
||||||
.supports_format = supports_format,
|
.supports_format = supports_format,
|
||||||
.init = init,
|
.init = init,
|
||||||
.decode = decode,
|
.decode = decode,
|
||||||
|
|
|
@ -155,6 +155,7 @@ static void uninit(struct sd *sd)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct sd_functions sd_lavc_conv = {
|
const struct sd_functions sd_lavc_conv = {
|
||||||
|
.name = "lavc_conv",
|
||||||
.supports_format = supports_format,
|
.supports_format = supports_format,
|
||||||
.init = init,
|
.init = init,
|
||||||
.decode = decode,
|
.decode = decode,
|
||||||
|
|
|
@ -329,6 +329,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct sd_functions sd_microdvd = {
|
const struct sd_functions sd_microdvd = {
|
||||||
|
.name = "microdvd",
|
||||||
.supports_format = supports_format,
|
.supports_format = supports_format,
|
||||||
.init = init,
|
.init = init,
|
||||||
.decode = decode,
|
.decode = decode,
|
||||||
|
|
|
@ -46,6 +46,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct sd_functions sd_movtext = {
|
const struct sd_functions sd_movtext = {
|
||||||
|
.name = "movtext",
|
||||||
.supports_format = supports_format,
|
.supports_format = supports_format,
|
||||||
.init = init,
|
.init = init,
|
||||||
.decode = decode,
|
.decode = decode,
|
||||||
|
|
|
@ -92,6 +92,7 @@ static void uninit(struct sd *sd)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct sd_functions sd_spu = {
|
const struct sd_functions sd_spu = {
|
||||||
|
.name = "spu",
|
||||||
.supports_format = supports_format,
|
.supports_format = supports_format,
|
||||||
.init = init,
|
.init = init,
|
||||||
.decode = decode,
|
.decode = decode,
|
||||||
|
|
|
@ -458,6 +458,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct sd_functions sd_srt = {
|
const struct sd_functions sd_srt = {
|
||||||
|
.name = "srt",
|
||||||
.supports_format = supports_format,
|
.supports_format = supports_format,
|
||||||
.init = init,
|
.init = init,
|
||||||
.decode = decode,
|
.decode = decode,
|
||||||
|
|
Loading…
Reference in New Issue