mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
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).
This commit is contained in:
parent
9db1323d31
commit
a7c64556ff
1 changed files with 19 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue