typefind: Only push pending buffers and events if we have caps

This commit is contained in:
Sebastian Dröge 2013-04-29 12:48:13 +02:00
parent 922815996f
commit cf0566f9ca

View file

@ -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;