mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-10 00:12:48 +00:00
discoverer: make is_subtitle_caps thread-safe
This commit is contained in:
parent
aa16155172
commit
1031fedaf0
1 changed files with 11 additions and 8 deletions
|
@ -438,19 +438,22 @@ _event_probe (GstPad * pad, GstEvent * event, PrivateStream * ps)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstStaticCaps subtitle_caps = GST_STATIC_CAPS ("text/plain; "
|
||||||
|
"text/x-pango-markup; subpicture/x-pgs; subpicture/x-dvb; "
|
||||||
|
"application/x-subtitle-unknown; application/x-ssa; application/x-ass; "
|
||||||
|
"subtitle/x-kate; application/x-kate; video/x-dvd-subpicture");
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_subtitle_caps (const GstCaps * caps)
|
is_subtitle_caps (const GstCaps * caps)
|
||||||
{
|
{
|
||||||
static GstCaps *subs_caps = NULL;
|
GstCaps *subs_caps;
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
if (!subs_caps) {
|
subs_caps = gst_static_caps_get (&subtitle_caps);
|
||||||
subs_caps = gst_caps_from_string ("text/plain; text/x-pango-markup; "
|
ret = gst_caps_can_intersect (caps, subs_caps);
|
||||||
"subpicture/x-pgs; subpicture/x-dvb; application/x-subtitle-unknown; "
|
gst_caps_unref (subs_caps);
|
||||||
"application/x-ssa; application/x-ass; subtitle/x-kate; "
|
|
||||||
"application/x-kate; video/x-dvd-subpicture; ");
|
|
||||||
}
|
|
||||||
|
|
||||||
return gst_caps_can_intersect (caps, subs_caps);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue