}
}
+ /* we need to make the metadata writable before pushing it in the jitterbuffer
+ * because the jitterbuffer will update the timestamp */
+ buffer = gst_buffer_make_metadata_writable (buffer);
+
/* now insert the packet into the queue in sorted order. This function returns
* FALSE if a packet with the same seqnum was already in the queue, meaning we
* have a duplicate. */
outbuf = rtp_jitter_buffer_pop (priv->jbuf);
if (discont || priv->discont) {
- /* set DISCONT flag when we missed a packet. */
- outbuf = gst_buffer_make_metadata_writable (outbuf);
+ /* set DISCONT flag when we missed a packet. We pushed the buffer writable
+ * into the jitterbuffer so we can modify now. */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
priv->discont = FALSE;
}
* Inserts @buf into the packet queue of @jbuf. The sequence number of the
* packet will be used to sort the packets. This function takes ownerhip of
* @buf when the function returns %TRUE.
+ * @buf should have writable metadata when calling this function.
*
* Returns: %FALSE if a packet with the same number already existed.
*/
if (!source)
return;
+ /* we somehow need to transfer the clock_base and the base time to the next
+ * element, we use the offset and offset_end fields in the buffer for this
+ * hack */
GST_BUFFER_OFFSET (packet->buffer) = source->clock_base;
GST_BUFFER_OFFSET_END (packet->buffer) = source->clock_base_time;
if (sess->sent_bye)
goto ignore;
+ /* make writable, we might want to change the buffer */
+ buffer = gst_buffer_make_metadata_writable (buffer);
+
/* start processing the compound packet */
more = gst_rtcp_buffer_get_first_packet (buffer, &packet);
while (more) {