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
This commit is contained in:
Wim Taymans 2013-04-24 15:38:50 +02:00
parent 7000e3303b
commit eac9efb92e
12 changed files with 22 additions and 22 deletions

View file

@ -231,8 +231,8 @@ gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
marker = gst_rtp_buffer_get_marker (&rtp);
if (marker) {
/* mark talk spurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark talk spurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
outbuf = gst_buffer_make_writable (outbuf);

View file

@ -405,9 +405,9 @@ gst_rtp_amr_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
GST_BUFFER_DURATION (outbuf) = num_packets * 20 * GST_MSECOND;
if (gst_rtp_buffer_get_marker (&rtp)) {
/* marker bit marks a discont buffer after a talkspurt. */
/* marker bit marks a buffer after a talkspurt. */
GST_DEBUG_OBJECT (depayload, "marker bit was set");
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
GST_DEBUG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT,

View file

@ -165,8 +165,8 @@ gst_rtp_bv_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
gst_rtp_buffer_unmap (&rtp);
if (marker && outbuf) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
return outbuf;

View file

@ -238,8 +238,8 @@ gst_rtp_g722_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
gst_rtp_buffer_unmap (&rtp);
if (marker && outbuf) {
/* mark talk spurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark talk spurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
return outbuf;

View file

@ -197,7 +197,7 @@ gst_rtp_g723_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
if (marker) {
/* marker bit starts talkspurt */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
GST_LOG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT,

View file

@ -329,8 +329,8 @@ gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
}
if (marker) {
/* mark start of talkspurt with discont */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
return outbuf;

View file

@ -202,7 +202,7 @@ gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
if (marker) {
/* marker bit starts talkspurt */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
GST_LOG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT,

View file

@ -136,8 +136,8 @@ gst_rtp_gsm_depay_process (GstRTPBaseDepayload * _depayload, GstBuffer * buf)
gst_rtp_buffer_unmap (&rtp);
if (marker && outbuf) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
return outbuf;

View file

@ -190,8 +190,8 @@ gst_rtp_ilbc_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
gst_rtp_buffer_unmap (&rtp);
if (marker && outbuf) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
return outbuf;

View file

@ -150,8 +150,8 @@ gst_rtp_mpa_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
marker = gst_rtp_buffer_get_marker (&rtp);
if (marker) {
/* mark start of talkspurt with discont */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
GST_DEBUG_OBJECT (rtpmpadepay,
"gst_rtp_mpa_depay_chain: pushing buffer of size %" G_GSIZE_FORMAT "",

View file

@ -148,8 +148,8 @@ gst_rtp_pcma_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
if (marker) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
}

View file

@ -149,8 +149,8 @@ gst_rtp_pcmu_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
gst_util_uint64_scale_int (len, GST_SECOND, depayload->clock_rate);
if (marker) {
/* mark start of talkspurt with DISCONT */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
}
}