summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Penquerc'h <ogg.k.ogg.k@googlemail.com>2009-07-20 12:25:15 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-07-20 13:25:11 +0100
commita7c64556ff25eae0ca3325dbbe166352b9b03006 (patch)
treee074a89734bb00f679b02e74fcc8baeebe70f0a6
parent9db1323d310d0fdb0a1e41b5278fc0c3fc84641e (diff)
downloadgst-plugins-bad-a7c64556ff25eae0ca3325dbbe166352b9b03006.tar.gz
gst-plugins-bad-a7c64556ff25eae0ca3325dbbe166352b9b03006.tar.bz2
gst-plugins-bad-a7c64556ff25eae0ca3325dbbe166352b9b03006.zip
kateenc: also recognise the new recommended 'SUB' category
Move the check for 'simple' subtitles category to a separate routine and add in the new recommended SUB category (#525743).
-rw-r--r--ext/kate/gstkateenc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/ext/kate/gstkateenc.c b/ext/kate/gstkateenc.c
index 6cc1f492..b9db9cda 100644
--- a/ext/kate/gstkateenc.c
+++ b/ext/kate/gstkateenc.c
@@ -525,6 +525,24 @@ gst_kate_enc_set_metadata (GstKateEnc * ke)
}
}
+static gboolean
+gst_kate_enc_is_simple_subtitle_category (GstKateEnc * ke, const char *category)
+{
+ static const char *const simple[] = {
+ "subtitles",
+ "SUB",
+ };
+ int n;
+
+ if (!category)
+ return FALSE;
+ for (n = 0; n < G_N_ELEMENTS (simple); ++n) {
+ if (!strcmp (category, simple[n]))
+ return TRUE;
+ }
+ return FALSE;
+}
+
static GstFlowReturn
gst_kate_enc_send_headers (GstKateEnc * ke)
{
@@ -559,7 +577,7 @@ gst_kate_enc_send_headers (GstKateEnc * ke)
}
if (rflow == GST_FLOW_OK) {
- if (ke->category != NULL && strstr (ke->category, "subtitle")) {
+ if (gst_kate_enc_is_simple_subtitle_category (ke, ke->category)) {
caps = gst_kate_util_set_header_on_caps (&ke->element,
gst_caps_from_string ("subtitle/x-kate"), headers);
} else {