- if (GST_EVENT_TYPE (event) == GST_EVENT_CAPS
- && filter->caps_change_mode == GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED) {
- GList *l;
- GstCaps *caps;
-
- gst_event_parse_caps (event, &caps);
-
- /* Remove all previous caps up to one that works.
- * Note that this might keep some leftover caps if there
- * are multiple compatible caps */
- GST_OBJECT_LOCK (filter);
- for (l = g_list_last (filter->previous_caps); l; l = l->prev) {
- if (gst_caps_can_intersect (caps, l->data)) {
- while (l->next) {
- gst_caps_unref (l->next->data);
- l = g_list_delete_link (l, l->next);
+ if (GST_EVENT_TYPE (event) == GST_EVENT_CAPS) {
+ filter->got_sink_caps = TRUE;
+ if (filter->caps_change_mode == GST_CAPS_FILTER_CAPS_CHANGE_MODE_DELAYED) {
+ GList *l;
+ GstCaps *caps;
+
+ gst_event_parse_caps (event, &caps);
+
+ /* Remove all previous caps up to one that works.
+ * Note that this might keep some leftover caps if there
+ * are multiple compatible caps */
+ GST_OBJECT_LOCK (filter);
+ for (l = g_list_last (filter->previous_caps); l; l = l->prev) {
+ if (gst_caps_can_intersect (caps, l->data)) {
+ while (l->next) {
+ gst_caps_unref (l->next->data);
+ l = g_list_delete_link (l, l->next);
+ }
+ break;