encodebin: activate ghost pad after creating it

This ensures the ghost pad will not stay in flushing mode
when it receives a flush stop event, and generally behave
badly.

This fixes at least one case of a dynamic decodebin2 + encodebin
pipeline finding a source that has not prerolled when it should
have been (due to the ghostpad staying in flushing mode).
This commit is contained in:
Vincent Penquerc'h 2013-02-14 15:59:51 +00:00
parent 1e5b50e94c
commit bccfc679b5

View file

@ -494,6 +494,7 @@ gst_encode_bin_init (GstEncodeBin * encode_bin)
tmpl = gst_static_pad_template_get (&muxer_src_template);
encode_bin->srcpad = gst_ghost_pad_new_no_target_from_template ("src", tmpl);
gst_object_unref (tmpl);
gst_pad_set_active (encode_bin->srcpad, TRUE);
gst_element_add_pad (GST_ELEMENT_CAST (encode_bin), encode_bin->srcpad);
}