[Bug 780446] gst_rtp_buffer_ext_timestamp() math is incorrect for big jumps

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Apr 7 19:54:58 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=780446

--- Comment #8 from Olivier CrĂȘte <olivier.crete at ocrete.ca> ---
After a little chat here and looking at how this is used by rtpjitterbuffer, we
think that yes, it can go back by a little.

To also account for the case where the first packet arrives second, but with a
timestamp of 0, we probably probably need to have
gst_rtp_buffer_ext_timestamp(-1, 0) == G_MAXUINT32, so that in the next time,
if we have gst_rtp_buffer_ext_timestamp(G_MAXUINT32, G_MAXUINT32 - 2), it
retuerns G_MAXUINT32-2 instead of something invalid.

So there should be a test like:
ext = -1;
gst_rtp_buffer_ext_timestamp(&ext, 1) == G_MAXUINT32 + 2
gst_rtp_buffer_ext_timestamp(&ext, 2) == G_MAXUINT32 + 3
gst_rtp_buffer_ext_timestamp(&ext, 0) == G_MAXUINT32 + 1
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32) == G_MAXUINT32
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 - 10 ) == G_MAXUINT32 - 10
gst_rtp_buffer_ext_timestamp(&ext, 3) == G_MAXUINT32 + 4

gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 / 4 ) == G_MAXUINT32 + 1 +
G_MAXUINT32/4
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 / 2 ) == G_MAXUINT32 + 1 +
G_MAXUINT32/2
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 / 3 ) == G_MAXUINT32 + 1 +
G_MAXUINT32/3
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 ) == 2*G_MAXUINT32
gst_rtp_buffer_ext_timestamp(&ext, 0 ) == 2*G_MAXUINT32 + 1
gst_rtp_buffer_ext_timestamp(&ext, 2 ) == 2*G_MAXUINT32 + 3
gst_rtp_buffer_ext_timestamp(&ext, 0 ) == 2*G_MAXUINT32 + 1

gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 / 4 ) == 2*G_MAXUINT32 + 1 +
G_MAXUINT32/4
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 / 2 ) == 2*G_MAXUINT32 + 1 +
G_MAXUINT32/2
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 / 3 ) == 2*G_MAXUINT32 + 1 +
G_MAXUINT32/3
gst_rtp_buffer_ext_timestamp(&ext, G_MAXUINT32 ) == 3*G_MAXUINT32
gst_rtp_buffer_ext_timestamp(&ext, 0 ) == 3*G_MAXUINT32 + 1
gst_rtp_buffer_ext_timestamp(&ext, 2 ) == 3*G_MAXUINT32 + 3
gst_rtp_buffer_ext_timestamp(&ext, 0 ) == 3*G_MAXUINT32 + 1

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list