mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
[MOVED FROM GST-P-FARSIGHT] Improve the minimum quanta to make it impossible for the duration to fall down to 0
This commit is contained in:
parent
1468b2e2b0
commit
6b42ee6ae1
1 changed files with 13 additions and 2 deletions
|
@ -371,8 +371,19 @@ gst_rtp_dtmf_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
|||
|
||||
/* clip to whole units of unit_time */
|
||||
if (rtpdtmfdepay->unit_time)
|
||||
dtmf_payload.duration -= dtmf_payload.duration %
|
||||
((rtpdtmfdepay->unit_time * depayload->clock_rate) / 1000);
|
||||
{
|
||||
guint unit_time_clock =
|
||||
(rtpdtmfdepay->unit_time * depayload->clock_rate) / 1000;
|
||||
if (dtmf_payload.duration % unit_time_clock)
|
||||
{
|
||||
/* Make sure we don't overflow the duration */
|
||||
if (dtmf_payload.duration < G_MAXUINT16 - unit_time_clock)
|
||||
dtmf_payload.duration += unit_time_clock -
|
||||
(dtmf_payload.duration % unit_time_clock);
|
||||
else
|
||||
dtmf_payload.duration -= dtmf_payload.duration % unit_time_clock;
|
||||
}
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (depayload, "Received new RTP DTMF packet : "
|
||||
"marker=%d - timestamp=%u - event=%d - duration=%d",
|
||||
|
|
Loading…
Reference in a new issue