From: Olivier CrĂȘte Date: Tue, 12 Jul 2011 00:47:23 +0000 (-0400) Subject: rtpdtmfsrc: Make sure rtpdtmfsrc timestamps don't overlap X-Git-Tag: 1.19.3~509^2~6027^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3de27c68baa571e4011cdc343b382866fd8774c;p=platform%2Fupstream%2Fgstreamer.git rtpdtmfsrc: Make sure rtpdtmfsrc timestamps don't overlap --- diff --git a/gst/dtmf/gstrtpdtmfsrc.c b/gst/dtmf/gstrtpdtmfsrc.c index 19acc6cae6..90e63fc6e1 100644 --- a/gst/dtmf/gstrtpdtmfsrc.c +++ b/gst/dtmf/gstrtpdtmfsrc.c @@ -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