mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
tsmux: Make sure to set srcpad caps under all conditions before outputting the first buffer
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1218 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2438>
This commit is contained in:
parent
12442748aa
commit
bf79a6908c
1 changed files with 15 additions and 0 deletions
|
@ -2319,6 +2319,21 @@ gst_base_ts_mux_aggregate (GstAggregator * agg, gboolean timeout)
|
|||
GstBaseTsMux *mux = GST_BASE_TS_MUX (agg);
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
GstBaseTsMuxPad *best = gst_base_ts_mux_find_best_pad (agg);
|
||||
GstCaps *caps;
|
||||
|
||||
/* set caps on the srcpad if no caps were set yet */
|
||||
if (!(caps = gst_pad_get_current_caps (agg->srcpad))) {
|
||||
GstStructure *structure;
|
||||
|
||||
caps = gst_pad_get_pad_template_caps (GST_AGGREGATOR_SRC_PAD (mux));
|
||||
caps = gst_caps_make_writable (caps);
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
gst_structure_set (structure, "packetsize", G_TYPE_INT, mux->packet_size,
|
||||
NULL);
|
||||
|
||||
gst_aggregator_set_src_caps (GST_AGGREGATOR (mux), caps);
|
||||
}
|
||||
gst_caps_unref (caps);
|
||||
|
||||
if (best) {
|
||||
GstBuffer *buffer;
|
||||
|
|
Loading…
Reference in a new issue