mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
baseaudiopay: fix timestamps on buffer lists
Fix the outgoing timestamps and RTP timestamps on outgoing buffers when using buffer lists.
This commit is contained in:
parent
bb786dfb5c
commit
678753b325
1 changed files with 7 additions and 8 deletions
|
@ -482,12 +482,11 @@ gst_base_rtp_audio_payload_push (GstBaseRTPAudioPayload * baseaudiopayload,
|
|||
|
||||
static GstFlowReturn
|
||||
gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
||||
baseaudiopayload, GstBuffer * buffer)
|
||||
baseaudiopayload, GstBuffer * buffer, GstClockTime timestamp)
|
||||
{
|
||||
GstBaseRTPPayload *basepayload;
|
||||
GstBaseRTPAudioPayloadPrivate *priv;
|
||||
GstBuffer *outbuf;
|
||||
GstClockTime timestamp;
|
||||
guint8 *payload;
|
||||
guint payload_len;
|
||||
GstFlowReturn ret;
|
||||
|
@ -496,7 +495,6 @@ gst_base_rtp_audio_payload_push_buffer (GstBaseRTPAudioPayload *
|
|||
basepayload = GST_BASE_RTP_PAYLOAD (baseaudiopayload);
|
||||
|
||||
payload_len = GST_BUFFER_SIZE (buffer);
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
||||
|
||||
GST_DEBUG_OBJECT (baseaudiopayload, "Pushing %d bytes ts %" GST_TIME_FORMAT,
|
||||
payload_len, GST_TIME_ARGS (timestamp));
|
||||
|
@ -607,7 +605,9 @@ gst_base_rtp_audio_payload_flush (GstBaseRTPAudioPayload * baseaudiopayload,
|
|||
* anything. */
|
||||
buffer = gst_adapter_take_buffer (adapter, payload_len);
|
||||
|
||||
ret = gst_base_rtp_audio_payload_push_buffer (baseaudiopayload, buffer);
|
||||
ret =
|
||||
gst_base_rtp_audio_payload_push_buffer (baseaudiopayload, buffer,
|
||||
timestamp);
|
||||
} else {
|
||||
/* create buffer to hold the payload */
|
||||
outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0);
|
||||
|
@ -814,23 +814,22 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
|
|||
guint align;
|
||||
guint size;
|
||||
gboolean discont;
|
||||
GstClockTime timestamp;
|
||||
|
||||
ret = GST_FLOW_OK;
|
||||
|
||||
payload = GST_BASE_RTP_AUDIO_PAYLOAD_CAST (basepayload);
|
||||
priv = payload->priv;
|
||||
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
||||
discont = GST_BUFFER_IS_DISCONT (buffer);
|
||||
if (discont) {
|
||||
GstClockTime timestamp;
|
||||
|
||||
GST_DEBUG_OBJECT (payload, "Got DISCONT");
|
||||
/* flush everything out of the adapter, mark DISCONT */
|
||||
ret = gst_base_rtp_audio_payload_flush (payload, -1, -1);
|
||||
priv->discont = TRUE;
|
||||
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
||||
|
||||
/* get the distance between the timestamp gap and produce the same gap in
|
||||
* the RTP timestamps */
|
||||
if (priv->last_timestamp != -1 && timestamp != -1) {
|
||||
|
@ -878,7 +877,7 @@ gst_base_rtp_audio_payload_handle_buffer (GstBaseRTPPayload *
|
|||
/* If buffer fits on an RTP packet, let's just push it through
|
||||
* this will check against max_ptime and max_mtu */
|
||||
GST_DEBUG_OBJECT (payload, "Fast packet push");
|
||||
ret = gst_base_rtp_audio_payload_push_buffer (payload, buffer);
|
||||
ret = gst_base_rtp_audio_payload_push_buffer (payload, buffer, timestamp);
|
||||
} else {
|
||||
/* push the buffer in the adapter */
|
||||
gst_adapter_push (priv->adapter, buffer);
|
||||
|
|
Loading…
Reference in a new issue