mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
rtpdtmfsrc: Make sure rtpdtmfsrc timestamps don't overlap
This commit is contained in:
parent
3a5d14993a
commit
a3de27c68b
1 changed files with 7 additions and 2 deletions
|
@ -506,7 +506,6 @@ gst_rtp_dtmf_prepare_timestamps (GstRTPDTMFSrc * dtmfsrc)
|
|||
GST_OBJECT_UNLOCK (dtmfsrc);
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (last_stop)) {
|
||||
dtmfsrc->timestamp = last_stop;
|
||||
dtmfsrc->start_timestamp = last_stop;
|
||||
} else {
|
||||
GstClock *clock = gst_element_get_clock (GST_ELEMENT (dtmfsrc));
|
||||
|
@ -516,10 +515,15 @@ gst_rtp_dtmf_prepare_timestamps (GstRTPDTMFSrc * dtmfsrc)
|
|||
|
||||
dtmfsrc->start_timestamp = gst_clock_get_time (clock)
|
||||
- gst_element_get_base_time (GST_ELEMENT (dtmfsrc));
|
||||
dtmfsrc->start_timestamp = dtmfsrc->timestamp;
|
||||
gst_object_unref (clock);
|
||||
}
|
||||
|
||||
/* If the last stop was in the past, then lets add the buffers together */
|
||||
if (dtmfsrc->start_timestamp < dtmfsrc->timestamp)
|
||||
dtmfsrc->start_timestamp = dtmfsrc->timestamp;
|
||||
|
||||
dtmfsrc->timestamp = dtmfsrc->start_timestamp;
|
||||
|
||||
dtmfsrc->rtp_timestamp = dtmfsrc->ts_base +
|
||||
gst_util_uint64_scale_int (gst_segment_to_running_time (&GST_BASE_SRC
|
||||
(dtmfsrc)->segment, GST_FORMAT_TIME, dtmfsrc->timestamp),
|
||||
|
@ -976,6 +980,7 @@ gst_rtp_dtmf_src_ready_to_paused (GstRTPDTMFSrc * dtmfsrc)
|
|||
else
|
||||
dtmfsrc->ts_base = dtmfsrc->ts_offset;
|
||||
|
||||
dtmfsrc->timestamp = 0;
|
||||
}
|
||||
|
||||
static GstStateChangeReturn
|
||||
|
|
Loading…
Reference in a new issue