From 3905482b3f65a9dc25a4c029c72d5398bdf8c9e3 Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Wed, 11 Jul 2007 15:51:57 +0000 Subject: [MOVED FROM GST-P-FARSIGHT] Send on packet start time 20070711155157-3e2dc-ee0e9fc13d35296593005267a2417dd65e790d29.gz --- gst/rtpdtmf/gstrtpdtmfsrc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gst/rtpdtmf/gstrtpdtmfsrc.c b/gst/rtpdtmf/gstrtpdtmfsrc.c index c3392971..3c7543cf 100644 --- a/gst/rtpdtmf/gstrtpdtmfsrc.c +++ b/gst/rtpdtmf/gstrtpdtmfsrc.c @@ -622,7 +622,7 @@ gst_rtp_dtmf_src_wait_for_buffer_ts (GstRTPDTMFSrc *dtmfsrc, GstBuffer * buf) GstClockID clock_id; GstClockReturn clock_ret; - clock_id = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp); + clock_id = gst_clock_new_single_shot_id (clock, GST_BUFFER_TIMESTAMP (buf)); clock_ret = gst_clock_id_wait (clock_id, NULL); if (clock_ret != GST_CLOCK_OK && clock_ret != GST_CLOCK_EARLY) { GST_ERROR_OBJECT (dtmfsrc, "Failed to wait on clock %s", @@ -660,10 +660,6 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc *dtmfsrc, GstBuffer *buf) gst_rtp_dtmf_prepare_rtp_headers (dtmfsrc, buf); - /* duration of DTMF payload */ - dtmfsrc->payload->duration += - dtmfsrc->interval * dtmfsrc->clock_rate / 1000; - /* timestamp and duration of GstBuffer */ GST_BUFFER_DURATION (buf) = dtmfsrc->interval * GST_MSECOND; GST_BUFFER_TIMESTAMP (buf) = dtmfsrc->timestamp; @@ -674,6 +670,11 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc *dtmfsrc, GstBuffer *buf) /* copy payload and convert to network-byte order */ g_memmove (payload, dtmfsrc->payload, sizeof (GstRTPDTMFPayload)); payload->duration = g_htons (payload->duration); + + /* duration of DTMF payload */ + dtmfsrc->payload->duration += + dtmfsrc->interval * dtmfsrc->clock_rate / 1000; + } static GstBuffer * -- cgit v1.2.1