Commit 577c1449 authored by Jan Schmidt's avatar Jan Schmidt

tcp/multihandlesink: Handle the case of no caps

Pass data with no caps and no streamheaders without
throwing a bunch of criticals
parent fbef9220
...@@ -1038,11 +1038,13 @@ gst_multi_handle_sink_client_queue_buffer (GstMultiHandleSink * mhsink, ...@@ -1038,11 +1038,13 @@ gst_multi_handle_sink_client_queue_buffer (GstMultiHandleSink * mhsink,
caps = gst_pad_get_current_caps (GST_BASE_SINK_PAD (sink)); caps = gst_pad_get_current_caps (GST_BASE_SINK_PAD (sink));
if (!mhclient->caps) { if (!mhclient->caps) {
GST_DEBUG_OBJECT (sink, if (caps) {
"%s no previous caps for this client, send streamheader", GST_DEBUG_OBJECT (sink,
mhclient->debug); "%s no previous caps for this client, send streamheader",
send_streamheader = TRUE; mhclient->debug);
mhclient->caps = gst_caps_ref (caps); send_streamheader = TRUE;
mhclient->caps = gst_caps_ref (caps);
}
} else { } else {
/* there were previous caps recorded, so compare */ /* there were previous caps recorded, so compare */
if (!gst_caps_is_equal (caps, mhclient->caps)) { if (!gst_caps_is_equal (caps, mhclient->caps)) {
...@@ -1086,8 +1088,7 @@ gst_multi_handle_sink_client_queue_buffer (GstMultiHandleSink * mhsink, ...@@ -1086,8 +1088,7 @@ gst_multi_handle_sink_client_queue_buffer (GstMultiHandleSink * mhsink,
} }
} }
/* Replace the old caps */ /* Replace the old caps */
gst_caps_unref (mhclient->caps); gst_caps_replace (&mhclient->caps, caps);
mhclient->caps = gst_caps_ref (caps);
} }
if (G_UNLIKELY (send_streamheader)) { if (G_UNLIKELY (send_streamheader)) {
...@@ -1127,7 +1128,8 @@ gst_multi_handle_sink_client_queue_buffer (GstMultiHandleSink * mhsink, ...@@ -1127,7 +1128,8 @@ gst_multi_handle_sink_client_queue_buffer (GstMultiHandleSink * mhsink,
} }
} }
gst_caps_unref (caps); if (caps)
gst_caps_unref (caps);
caps = NULL; caps = NULL;
GST_LOG_OBJECT (sink, "%s queueing buffer of length %" G_GSIZE_FORMAT, GST_LOG_OBJECT (sink, "%s queueing buffer of length %" G_GSIZE_FORMAT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment