gst/rtpmanager/rtpjitterbuffer.*: Fix undefined overflow prone ts_diff handling.

Original commit message from CVS:
* gst/rtpmanager/rtpjitterbuffer.c:
(rtp_jitter_buffer_get_ts_diff):
* gst/rtpmanager/rtpjitterbuffer.h:
Fix undefined overflow prone ts_diff handling.
This commit is contained in:
Wim Taymans 2007-08-21 16:04:47 +00:00
parent 332899b3b4
commit 214410b343
3 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2007-08-21 Wim Taymans <wim.taymans@gmail.com>
* gst/rtpmanager/rtpjitterbuffer.c:
(rtp_jitter_buffer_get_ts_diff):
* gst/rtpmanager/rtpjitterbuffer.h:
Fix undefined overflow prone ts_diff handling.
2007-08-21 Wim Taymans <wim.taymans@gmail.com>
* gst/modplug/gstmodplug.cc:

View file

@ -215,8 +215,9 @@ rtp_jitter_buffer_num_packets (RTPJitterBuffer * jbuf)
guint32
rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer * jbuf)
{
guint32 high_ts, low_ts;
guint64 high_ts, low_ts;
GstBuffer *high_buf, *low_buf;
guint32 result;
g_return_val_if_fail (jbuf != NULL, 0);
@ -231,8 +232,9 @@ rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer * jbuf)
/* it needs to work if ts wraps */
if (high_ts >= low_ts) {
return high_ts - low_ts;
result = (guint32) (high_ts - low_ts);
} else {
return high_ts + G_MAXUINT32 + 1 - low_ts;
result = (guint32) (high_ts + G_MAXUINT32 + 1 - low_ts);
}
return result;
}

View file

@ -62,6 +62,4 @@ void rtp_jitter_buffer_flush (RTPJitterBuffer *jbuf);
guint rtp_jitter_buffer_num_packets (RTPJitterBuffer *jbuf);
guint32 rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer *jbuf);
#endif /* __RTP_JITTER_BUFFER_H__ */