mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
oggmux: Make sure to always set caps on the srcpad and always send a segment event
Even if the srcpad is not linked at this point, it might be linked as result of setting the caps.
This commit is contained in:
parent
46aff49316
commit
1d20c0f4bb
1 changed files with 14 additions and 9 deletions
|
@ -1543,16 +1543,21 @@ gst_ogg_mux_send_headers (GstOggMux * mux)
|
|||
if (caps) {
|
||||
if (!gst_caps_is_fixed (caps))
|
||||
caps = gst_caps_fixate (caps);
|
||||
if (caps) {
|
||||
GstSegment segment;
|
||||
|
||||
caps = gst_ogg_mux_set_header_on_caps (caps, hbufs);
|
||||
gst_pad_set_caps (mux->srcpad, caps);
|
||||
gst_segment_init (&segment, GST_FORMAT_TIME);
|
||||
gst_pad_push_event (mux->srcpad, gst_event_new_segment (&segment));
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
}
|
||||
if (!caps)
|
||||
caps = gst_caps_new_empty_simple ("application/ogg");
|
||||
|
||||
caps = gst_ogg_mux_set_header_on_caps (caps, hbufs);
|
||||
gst_pad_set_caps (mux->srcpad, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
/* Send segment event */
|
||||
{
|
||||
GstSegment segment;
|
||||
gst_segment_init (&segment, GST_FORMAT_TIME);
|
||||
gst_pad_push_event (mux->srcpad, gst_event_new_segment (&segment));
|
||||
}
|
||||
|
||||
/* and send the buffers */
|
||||
while (hbufs != NULL) {
|
||||
GstBuffer *buf = GST_BUFFER (hbufs->data);
|
||||
|
|
Loading…
Reference in a new issue