diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-08-21 16:04:47 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-08-21 16:04:47 +0000 |
commit | 214410b343fba930f12cc6244006646b27788e29 (patch) | |
tree | 80c159be31f56ee576ac3390a09b512b73f73871 | |
parent | 332899b3b4155195b5d25d31ab078f9c5f811117 (diff) | |
download | gst-plugins-bad-214410b343fba930f12cc6244006646b27788e29.tar.gz gst-plugins-bad-214410b343fba930f12cc6244006646b27788e29.tar.bz2 gst-plugins-bad-214410b343fba930f12cc6244006646b27788e29.zip |
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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gst/rtpmanager/rtpjitterbuffer.c | 8 | ||||
-rw-r--r-- | gst/rtpmanager/rtpjitterbuffer.h | 2 |
3 files changed, 12 insertions, 5 deletions
@@ -1,5 +1,12 @@ 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: Fix compiler warning. diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c index 1ba1c819..c36a25c5 100644 --- a/gst/rtpmanager/rtpjitterbuffer.c +++ b/gst/rtpmanager/rtpjitterbuffer.c @@ -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; } diff --git a/gst/rtpmanager/rtpjitterbuffer.h b/gst/rtpmanager/rtpjitterbuffer.h index 14b5b3f2..8bff03c8 100644 --- a/gst/rtpmanager/rtpjitterbuffer.h +++ b/gst/rtpmanager/rtpjitterbuffer.h @@ -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__ */ |