mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
fix: when starting typefinding, make sure we're paused
Original commit message from CVS: fix: when starting typefinding, make sure we're paused
This commit is contained in:
parent
09c87262ef
commit
aa66954b9a
1 changed files with 11 additions and 0 deletions
|
@ -357,8 +357,14 @@ static void
|
|||
gst_spider_identity_start_typefinding (GstSpiderIdentity *ident)
|
||||
{
|
||||
GstElement* typefind;
|
||||
gboolean restart = FALSE;
|
||||
|
||||
GST_DEBUG (GST_CAT_AUTOPLUG, "element %s starts typefinding\n", GST_ELEMENT_NAME(ident));
|
||||
if (GST_STATE (GST_ELEMENT_PARENT (ident)) == GST_STATE_PLAYING)
|
||||
{
|
||||
gst_element_set_state (GST_ELEMENT (GST_ELEMENT_PARENT (ident)), GST_STATE_PAUSED);
|
||||
restart = TRUE;
|
||||
}
|
||||
|
||||
/* create and connect typefind object */
|
||||
typefind = gst_elementfactory_make ("typefind", g_strdup_printf("%s%s", "typefind", GST_ELEMENT_NAME(ident)));
|
||||
|
@ -368,6 +374,11 @@ gst_spider_identity_start_typefinding (GstSpiderIdentity *ident)
|
|||
gst_pad_connect (gst_element_get_compatible_pad ((GstElement *) ident, gst_element_get_pad (typefind, "sink")), gst_element_get_pad (typefind, "sink"));
|
||||
|
||||
gst_element_set_loop_function (GST_ELEMENT (ident), (GstElementLoopFunction) GST_DEBUG_FUNCPTR (gst_spider_identity_sink_loop_typefinding));
|
||||
|
||||
if (restart)
|
||||
{
|
||||
gst_element_set_state (GST_ELEMENT (GST_ELEMENT_PARENT (ident)), GST_STATE_PLAYING);
|
||||
}
|
||||
}
|
||||
/* waiting for a good suggestion on where to set the caps from typefinding
|
||||
* Caps must be cleared when pad is disconnected
|
||||
|
|
Loading…
Reference in a new issue