diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 4e21240673..3a89c3da6a 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -543,12 +543,13 @@ stop_typefinding (GstTypeFindElement * typefind) gst_element_get_state (GST_ELEMENT (typefind), &state, NULL, 0); - push_cached_buffers = (state >= GST_STATE_PAUSED); + GST_OBJECT_LOCK (typefind); + + push_cached_buffers = (state >= GST_STATE_PAUSED && typefind->caps); GST_DEBUG_OBJECT (typefind, "stopping typefinding%s", push_cached_buffers ? " and pushing cached buffers" : ""); - GST_OBJECT_LOCK (typefind); avail = gst_adapter_available (typefind->adapter); if (avail == 0) goto no_data;