From eac9efb92e22fcfa41e915e3db0b6d95e397a222 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 24 Apr 2013 15:38:50 +0200 Subject: [PATCH] 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 --- gst/rtp/gstrtpL16depay.c | 4 ++-- gst/rtp/gstrtpamrdepay.c | 4 ++-- gst/rtp/gstrtpbvdepay.c | 4 ++-- gst/rtp/gstrtpg722depay.c | 4 ++-- gst/rtp/gstrtpg723depay.c | 2 +- gst/rtp/gstrtpg726depay.c | 4 ++-- gst/rtp/gstrtpg729depay.c | 2 +- gst/rtp/gstrtpgsmdepay.c | 4 ++-- gst/rtp/gstrtpilbcdepay.c | 4 ++-- gst/rtp/gstrtpmpadepay.c | 4 ++-- gst/rtp/gstrtppcmadepay.c | 4 ++-- gst/rtp/gstrtppcmudepay.c | 4 ++-- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gst/rtp/gstrtpL16depay.c b/gst/rtp/gstrtpL16depay.c index ac6e082683..880451f942 100644 --- a/gst/rtp/gstrtpL16depay.c +++ b/gst/rtp/gstrtpL16depay.c @@ -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); diff --git a/gst/rtp/gstrtpamrdepay.c b/gst/rtp/gstrtpamrdepay.c index 8ce0cc0490..25a4508621 100644 --- a/gst/rtp/gstrtpamrdepay.c +++ b/gst/rtp/gstrtpamrdepay.c @@ -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, diff --git a/gst/rtp/gstrtpbvdepay.c b/gst/rtp/gstrtpbvdepay.c index b1fde6abfd..67fbb0cb6c 100644 --- a/gst/rtp/gstrtpbvdepay.c +++ b/gst/rtp/gstrtpbvdepay.c @@ -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; diff --git a/gst/rtp/gstrtpg722depay.c b/gst/rtp/gstrtpg722depay.c index c71d5bc996..c77fb95138 100644 --- a/gst/rtp/gstrtpg722depay.c +++ b/gst/rtp/gstrtpg722depay.c @@ -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; diff --git a/gst/rtp/gstrtpg723depay.c b/gst/rtp/gstrtpg723depay.c index 9d172e24cf..b8226889b8 100644 --- a/gst/rtp/gstrtpg723depay.c +++ b/gst/rtp/gstrtpg723depay.c @@ -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, diff --git a/gst/rtp/gstrtpg726depay.c b/gst/rtp/gstrtpg726depay.c index d1b413796f..45d99dc835 100644 --- a/gst/rtp/gstrtpg726depay.c +++ b/gst/rtp/gstrtpg726depay.c @@ -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; diff --git a/gst/rtp/gstrtpg729depay.c b/gst/rtp/gstrtpg729depay.c index 6c745b84d8..f763e4cd83 100644 --- a/gst/rtp/gstrtpg729depay.c +++ b/gst/rtp/gstrtpg729depay.c @@ -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, diff --git a/gst/rtp/gstrtpgsmdepay.c b/gst/rtp/gstrtpgsmdepay.c index a0f8a13d86..96b30cfe85 100644 --- a/gst/rtp/gstrtpgsmdepay.c +++ b/gst/rtp/gstrtpgsmdepay.c @@ -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; diff --git a/gst/rtp/gstrtpilbcdepay.c b/gst/rtp/gstrtpilbcdepay.c index d9d3ba52aa..8b4285e1c7 100644 --- a/gst/rtp/gstrtpilbcdepay.c +++ b/gst/rtp/gstrtpilbcdepay.c @@ -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; diff --git a/gst/rtp/gstrtpmpadepay.c b/gst/rtp/gstrtpmpadepay.c index 82da118ae2..bc9ff06e03 100644 --- a/gst/rtp/gstrtpmpadepay.c +++ b/gst/rtp/gstrtpmpadepay.c @@ -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 "", diff --git a/gst/rtp/gstrtppcmadepay.c b/gst/rtp/gstrtppcmadepay.c index 3d9c3aa9b4..d4fb2afb7e 100644 --- a/gst/rtp/gstrtppcmadepay.c +++ b/gst/rtp/gstrtppcmadepay.c @@ -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); } } diff --git a/gst/rtp/gstrtppcmudepay.c b/gst/rtp/gstrtppcmudepay.c index 4da9950f6b..14367a10b0 100644 --- a/gst/rtp/gstrtppcmudepay.c +++ b/gst/rtp/gstrtppcmudepay.c @@ -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); } }