mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
rtpbasepayload: don't write empty extension header
When some header extensions are present but none decides to write any data to the currently processed RTP buffer, remove the extension data section. Resulting RTP buffer wasn't formatted correctly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1173>
This commit is contained in:
parent
d294d7da36
commit
556ce36ce4
1 changed files with 9 additions and 5 deletions
|
@ -1764,13 +1764,17 @@ set_headers (GstBuffer ** buffer, guint idx, gpointer user_data)
|
|||
g_ptr_array_foreach (data->payload->priv->header_exts,
|
||||
(GFunc) write_header_extension, &hdrext);
|
||||
|
||||
wordlen = hdrext.written_size / 4 + ((hdrext.written_size % 4) ? 1 : 0);
|
||||
if (hdrext.written_size > 0) {
|
||||
wordlen = hdrext.written_size / 4 + ((hdrext.written_size % 4) ? 1 : 0);
|
||||
|
||||
/* zero-fill the hdrext padding bytes */
|
||||
memset (&hdrext.data[hdrext.written_size], 0,
|
||||
wordlen * 4 - hdrext.written_size);
|
||||
/* zero-fill the hdrext padding bytes */
|
||||
memset (&hdrext.data[hdrext.written_size], 0,
|
||||
wordlen * 4 - hdrext.written_size);
|
||||
|
||||
gst_rtp_buffer_set_extension_data (&rtp, bit_pattern, wordlen);
|
||||
gst_rtp_buffer_set_extension_data (&rtp, bit_pattern, wordlen);
|
||||
} else {
|
||||
gst_rtp_buffer_remove_extension_data (&rtp);
|
||||
}
|
||||
}
|
||||
GST_OBJECT_UNLOCK (data->payload);
|
||||
gst_rtp_buffer_unmap (&rtp);
|
||||
|
|
Loading…
Reference in a new issue