diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-05-10 11:24:46 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-05-10 11:24:46 +0200 |
commit | 1d20c0f4bb1d2af48e4d71506120a1c999c791e7 (patch) | |
tree | ecb21a75518ea14547eeabc8658f59c5d4ed20d5 /ext/ogg/gstoggmux.c | |
parent | 46aff49316cfaf2ec44dc5e1fde780fbfc857823 (diff) |
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.
Diffstat (limited to 'ext/ogg/gstoggmux.c')
-rw-r--r-- | ext/ogg/gstoggmux.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index f4c914ad9..a125da969 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -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; + } + 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_segment_init (&segment, GST_FORMAT_TIME); - gst_pad_push_event (mux->srcpad, gst_event_new_segment (&segment)); - gst_caps_unref (caps); - } + 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); |