mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
typefind: Stop typefinding if we get a CAPS event from upstream
This commit is contained in:
parent
0fda329bbb
commit
2a34f767d4
1 changed files with 1 additions and 22 deletions
|
@ -719,34 +719,13 @@ gst_type_find_element_setcaps (GstTypeFindElement * typefind, GstCaps * caps)
|
||||||
|
|
||||||
/* Shortcircuit typefinding if we get caps */
|
/* Shortcircuit typefinding if we get caps */
|
||||||
if (typefind->mode == MODE_TYPEFIND) {
|
if (typefind->mode == MODE_TYPEFIND) {
|
||||||
GstBuffer *buffer;
|
|
||||||
gsize avail;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (typefind, "Skipping typefinding, using caps from "
|
GST_DEBUG_OBJECT (typefind, "Skipping typefinding, using caps from "
|
||||||
"upstream: %" GST_PTR_FORMAT, caps);
|
"upstream: %" GST_PTR_FORMAT, caps);
|
||||||
typefind->mode = MODE_NORMAL;
|
|
||||||
|
|
||||||
gst_type_find_element_send_cached_events (typefind);
|
stop_typefinding (typefind);
|
||||||
GST_OBJECT_LOCK (typefind);
|
|
||||||
avail = gst_adapter_available (typefind->adapter);
|
|
||||||
if (avail == 0)
|
|
||||||
goto no_data;
|
|
||||||
|
|
||||||
buffer = gst_adapter_take_buffer (typefind->adapter, avail);
|
|
||||||
GST_OBJECT_UNLOCK (typefind);
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (typefind, "Pushing buffer: %" G_GSIZE_FORMAT, avail);
|
|
||||||
gst_pad_push (typefind->src, buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
no_data:
|
|
||||||
{
|
|
||||||
GST_DEBUG_OBJECT (typefind, "no data to push");
|
|
||||||
GST_OBJECT_UNLOCK (typefind);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
|
|
Loading…
Reference in a new issue