GNOME Bugzilla – Bug 627204
Some audio-based depayloaders are sometimes incorrectly indicating discont flag and RTP-marker bit.
Last modified: 2013-04-24 13:45:27 UTC
We have noted in some models of Axis IP cameras (Axis 223M in particular), the audio-based depayloaders (726, 711 u/a) are incorrectly setting the DISCONT flag and also invalidly determining a "talkspurt" (marker bit is always set). We modified the code to use RTP timestamp calculation to determine discontinuity.
Created attachment 168123 [details] [review] 726depay.c patch
Created attachment 168124 [details] [review] 726depay.h patch
Created attachment 168125 [details] [review] 711alaw.c patch
Created attachment 168126 [details] [review] 711 alaw.h patch
Created attachment 168127 [details] [review] 711 ulaw.c patch
Created attachment 168128 [details] [review] 711 ulaw.h patch
Review of attachment 168125 [details] [review]: ::: gstrtppcmadepay.c @@ +145,3 @@ + gboolean marker, guint32 timestamp) +{ + return (marker && timestamp != depayload->predicted_rtp_ts) ? TRUE : FALSE; "? TRUE : FALSE" is entirely redundant here @@ +175,3 @@ + if (!GST_BUFFER_IS_DISCONT (buf) && + gst_rtp_pcma_depay_is_talkspurt (depay, marker, timestamp)) { Do you really mean to never set the discont flag on the output if it was set on the input buffer ? Shouldn't it be "GST_BUFFER_IS_DISCONT (buf) && .." ? Or am I lost ?
Is this because the camera is always setting the marker bit, even when there is not really any talk spurt?
(In reply to comment #8) > Is this because the camera is always setting the marker bit, even when there is > not really any talk spurt? Yes, that is the problem, so we added an additional check that the timestamps actually reflect a gap before indicating discont.
I don't see how this can work. The base class remembers the DISCONT flag on the input buffer and marks DISCONT on the next output buffer, there is nothing a subclass can do about that.
How should we go ahead with this bug?
I believe this is the way to go in 1.0, don't set the DISCONT flag but use the RESYNC flag: commit eac9efb92e22fcfa41e915e3db0b6d95e397a222 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed Apr 24 15:38:50 2013 +0200 rtp: a marker bit should translate to RESYNC A marker bit on an audio packet does not mean a DISCONT (in the GStreamer sense of missing data) but it means that the packet is the end of a talkspurt and thus a good opportunity to resync to the clock. Use the RESYNC buffer flag to note this. Real discontinuities are marked with DISCONT still when the seqnum has a GAP or when the input buffer has the DISCONT flag set. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=627204