summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-03 21:49:39 +0200
committerwm4 <wm4@nowhere>2013-06-03 22:40:32 +0200
commit61dfe121791adf953386642844cd9258ba99f179 (patch)
treeaf462c71bf0fba132a1e90ab89fc96ec779e6afe
parent3289be9a2856c0f935fcb49768fc39d878044202 (diff)
downloadmpv-61dfe121791adf953386642844cd9258ba99f179.tar.bz2
mpv-61dfe121791adf953386642844cd9258ba99f179.tar.xz
sub: add name field to all sub decoders
Might help with debugging.
-rw-r--r--sub/dec_sub.c12
-rw-r--r--sub/sd.h1
-rw-r--r--sub/sd_ass.c1
-rw-r--r--sub/sd_lavc.c1
-rw-r--r--sub/sd_lavc_conv.c1
-rw-r--r--sub/sd_microdvd.c1
-rw-r--r--sub/sd_movtext.c1
-rw-r--r--sub/sd_spu.c1
-rw-r--r--sub/sd_srt.c1
9 files changed, 20 insertions, 0 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index 4eb0dfa99f..b72630470c 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -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;
diff --git a/sub/sd.h b/sub/sd.h
index a2f57a5808..4268137921 100644
--- a/sub/sd.h
+++ b/sub/sd.h
@@ -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);
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index c4373d4511..c46c55c1ab 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -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,
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index 9f8db2d877..cb90e78a56 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -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,
diff --git a/sub/sd_lavc_conv.c b/sub/sd_lavc_conv.c
index 5653ad87f9..1fc0262f96 100644
--- a/sub/sd_lavc_conv.c
+++ b/sub/sd_lavc_conv.c
@@ -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,
diff --git a/sub/sd_microdvd.c b/sub/sd_microdvd.c
index eba5b67576..adf8679676 100644
--- a/sub/sd_microdvd.c
+++ b/sub/sd_microdvd.c
@@ -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,
diff --git a/sub/sd_movtext.c b/sub/sd_movtext.c
index 30d2da8254..a6ef120ec7 100644
--- a/sub/sd_movtext.c
+++ b/sub/sd_movtext.c
@@ -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,
diff --git a/sub/sd_spu.c b/sub/sd_spu.c
index d2dd5f56e0..c6aed81641 100644
--- a/sub/sd_spu.c
+++ b/sub/sd_spu.c
@@ -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,
diff --git a/sub/sd_srt.c b/sub/sd_srt.c
index ec4768a598..fcad088dc1 100644
--- a/sub/sd_srt.c
+++ b/sub/sd_srt.c
@@ -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,