diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-21 15:37:31 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-21 15:37:31 +0100 |
commit | 383f58b0ed15c5fd14d2a760719295256f6ba545 (patch) | |
tree | 5c13e14d0a7885d23d0b67ba6b650054d9254187 | |
parent | 9084bc151be66c7271a5b3679e0e3dc653e96fb2 (diff) |
subtitleoverlay: Return ANY caps for the GET_CAPS query
subtitleoverlay handles any caps, not just the ones
for which a subtitle parser/renderer exist. It will
just ignore any unsupported streams instead of causing
an error.
https://bugzilla.gnome.org/show_bug.cgi?id=688476
-rw-r--r-- | gst/playback/gstsubtitleoverlay.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c index 639cfc332..70af107b2 100644 --- a/gst/playback/gstsubtitleoverlay.c +++ b/gst/playback/gstsubtitleoverlay.c @@ -1936,23 +1936,12 @@ gst_subtitle_overlay_subtitle_sink_chain (GstPad * pad, GstObject * parent, static GstCaps * gst_subtitle_overlay_subtitle_sink_getcaps (GstPad * pad, GstCaps * filter) { - GstSubtitleOverlay *self = GST_SUBTITLE_OVERLAY (gst_pad_get_parent (pad)); GstCaps *ret; - g_mutex_lock (&self->factories_lock); - if (G_UNLIKELY (!gst_subtitle_overlay_update_factory_list (self))) - ret = gst_caps_new_empty (); - else if (filter) - ret = - gst_caps_intersect_full (filter, self->factory_caps, - GST_CAPS_INTERSECT_FIRST); + if (filter) + ret = gst_caps_ref (filter); else - ret = gst_caps_ref (self->factory_caps); - g_mutex_unlock (&self->factories_lock); - - GST_DEBUG_OBJECT (pad, "Returning subtitle caps %" GST_PTR_FORMAT, ret); - - gst_object_unref (self); + ret = gst_caps_new_any (); return ret; } @@ -2189,13 +2178,7 @@ gst_subtitle_overlay_subtitle_sink_query (GstPad * pad, GstObject * parent, switch (GST_QUERY_TYPE (query)) { case GST_QUERY_ACCEPT_CAPS: { - GstCaps *caps, *othercaps; - - gst_query_parse_accept_caps (query, &caps); - othercaps = gst_subtitle_overlay_subtitle_sink_getcaps (pad, NULL); - ret = gst_caps_is_subset (caps, othercaps); - gst_caps_unref (othercaps); - gst_query_set_accept_caps_result (query, ret); + gst_query_set_accept_caps_result (query, TRUE); ret = TRUE; break; } |