rtpdtmfsrc: Correctly recognize the end of a buffer
authorOlivier Crête <olivier.crete@collabora.com>
Tue, 12 Jul 2011 01:31:07 +0000 (21:31 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Wed, 24 Aug 2011 16:24:18 +0000 (12:24 -0400)
gst/dtmf/gstrtpdtmfsrc.c

index 90e63fc6e10ddf77e09ee049e7343ec858d941a0..89e8c00270ef71995d400ffc5b2fc6f3bfebe992 100644 (file)
@@ -605,10 +605,11 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc * dtmfsrc, GstBuffer * buf)
 
   /* duration of DTMF payloadfor the NEXT packet */
   /* not updated for redundant packets */
-  if (dtmfsrc->redundancy_count == 0)
+  if (dtmfsrc->redundancy_count <= 1)
     dtmfsrc->payload->duration += dtmfsrc->ptime * dtmfsrc->clock_rate / 1000;
 
-  if (dtmfsrc->redundancy_count == 0 && dtmfsrc->last_packet) {
+
+  if (dtmfsrc->redundancy_count <= 1 && dtmfsrc->last_packet) {
     GstClockTime inter_digit_interval = MIN_INTER_DIGIT_INTERVAL;
 
     if (inter_digit_interval % dtmfsrc->ptime != 0)