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

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Apr 10 09:20:25 UTC 2017


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

--- Comment #11 from George Kiagiadakis <gkiagia at tolabaki.gr> ---
The original issue that was discovered with this function is that when ext is
already G_MAXUINT32 + 1 and you try to set G_MAXUINT32 for the timestamp, it
awkwardly returns 3*G_MAXUINT32 + 2.

This is wrong in both cases (allowing and not allowing timestamps to go
backwards). If we allow them to go backwards, it should return G_MAXUINT32. If
we don't allow them, it should return 2*G_MAXUINT32 + 1.

For the fix, I considered what the doc says, i.e. timestamps are NOT allowed to
go backwards, so my patch simply implements this behavior. Instead of comparing
with G_MAXINT32 (which basically allows going backwards by at most G_MAXINT32
time units, if the timestamp is not wrapping around), my patch simply checks if
the timestamp is smaller than the previous value, which means it went upwards
and wrapped around.

-- 
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