aboutsummaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
Diffstat (limited to 'gst')
-rw-r--r--gst/audiofx/audiocheblimit.c4
-rw-r--r--gst/audiofx/audiofirfilter.c4
-rw-r--r--gst/audiofx/audiofxbaseiirfilter.c12
-rw-r--r--gst/audiofx/audioiirfilter.c4
-rw-r--r--gst/audioparsers/gstaacparse.c8
-rw-r--r--gst/isomp4/qtdemux.c4
-rw-r--r--gst/level/gstlevel.c4
-rw-r--r--gst/rtp/gstrtpamrdepay.c6
-rw-r--r--gst/rtp/gstrtph264depay.c46
-rw-r--r--gst/rtp/gstrtpilbcdepay.c4
-rw-r--r--gst/rtp/gstrtpjpegpay.c8
-rw-r--r--gst/rtp/gstrtpsirendepay.c4
-rw-r--r--gst/rtp/gstrtpspeexdepay.c4
-rw-r--r--gst/rtpmanager/gstrtpjitterbuffer.c135
-rw-r--r--gst/rtpmanager/rtpjitterbuffer.c25
-rw-r--r--gst/rtpmanager/rtpjitterbuffer.h4
-rw-r--r--gst/rtpmanager/rtpsession.c3
-rw-r--r--gst/rtsp/gstrtspsrc.c1
-rw-r--r--gst/spectrum/gstspectrum.c4
-rw-r--r--gst/udp/gstudpsrc.c3
20 files changed, 180 insertions, 107 deletions
diff --git a/gst/audiofx/audiocheblimit.c b/gst/audiofx/audiocheblimit.c
index 549a9d2e..e2788866 100644
--- a/gst/audiofx/audiocheblimit.c
+++ b/gst/audiofx/audiocheblimit.c
@@ -46,12 +46,12 @@
* be at most this value. A lower ripple value will allow a faster rolloff.
*
* As a special case, a Chebyshev type 1 filter with no ripple is a Butterworth filter.
- * </para>
+ *
* <note><para>
* Be warned that a too large number of poles can produce noise. The most poles are possible with
* a cutoff frequency at a quarter of the sampling rate.
* </para></note>
- * <para>
+ *
* <refsect2>
* <title>Example launch line</title>
* |[
diff --git a/gst/audiofx/audiofirfilter.c b/gst/audiofx/audiofirfilter.c
index e0887ad4..0ab32f37 100644
--- a/gst/audiofx/audiofirfilter.c
+++ b/gst/audiofx/audiofirfilter.c
@@ -39,9 +39,9 @@
*
* <refsect2>
* <title>Example application</title>
- * |[
+ * <informalexample><programlisting language="C">
* <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" parse="text" href="../../../../tests/examples/audiofx/firfilter-example.c" />
- * ]|
+ * </programlisting></informalexample>
* </refsect2>
*/
diff --git a/gst/audiofx/audiofxbaseiirfilter.c b/gst/audiofx/audiofxbaseiirfilter.c
index 1ce4d8bc..93553e8f 100644
--- a/gst/audiofx/audiofxbaseiirfilter.c
+++ b/gst/audiofx/audiofxbaseiirfilter.c
@@ -372,16 +372,16 @@ gst_audio_fx_base_iir_filter_transform_ip (GstBaseTransform * base,
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (filter), stream_time);
- if (filter->a == NULL || filter->b == NULL) {
- g_return_val_if_fail (filter->a != NULL
- && filter->b != NULL, GST_FLOW_ERROR);
- return GST_FLOW_ERROR;
- }
-
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
num_samples = map.size / GST_AUDIO_FILTER_BPS (filter);
g_mutex_lock (&filter->lock);
+ if (filter->a == NULL || filter->b == NULL) {
+ g_warn_if_fail (filter->a != NULL && filter->b != NULL);
+ gst_buffer_unmap (buf, &map);
+ g_mutex_unlock (&filter->lock);
+ return GST_FLOW_ERROR;
+ }
filter->process (filter, map.data, num_samples);
g_mutex_unlock (&filter->lock);
diff --git a/gst/audiofx/audioiirfilter.c b/gst/audiofx/audioiirfilter.c
index c107594d..eb4f20ce 100644
--- a/gst/audiofx/audioiirfilter.c
+++ b/gst/audiofx/audioiirfilter.c
@@ -35,9 +35,9 @@
*
* <refsect2>
* <title>Example application</title>
- * |[
+ * <informalexample><programlisting language="C">
* <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" parse="text" href="../../../../tests/examples/audiofx/iirfilter-example.c" />
- * ]|
+ * </programlisting></informalexample>
* </refsect2>
*/
diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c
index ce7f6fe1..569cffab 100644
--- a/gst/audioparsers/gstaacparse.c
+++ b/gst/audioparsers/gstaacparse.c
@@ -392,6 +392,14 @@ gst_aac_parse_check_adts_frame (GstAacParse * aacparse,
return FALSE;
if ((data[0] == 0xff) && ((data[1] & 0xf6) == 0xf0)) {
+
+ /* This looks like an ADTS frame header but
+ we need at least 6 bytes to proceed */
+ if (G_UNLIKELY (avail < 6)) {
+ *needed_data = 6;
+ return FALSE;
+ }
+
*framesize = gst_aac_parse_adts_get_frame_len (data);
/* In EOS mode this is enough. No need to examine the data further.
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 6be2abc1..8d5e688d 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -4168,7 +4168,9 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
/* check for segment end */
if (G_UNLIKELY (qtdemux->segment.stop != -1
- && qtdemux->segment.stop <= min_time
+ && ((qtdemux->segment.rate >= 0 && qtdemux->segment.stop <= min_time)
+ || (qtdemux->segment.rate < 0
+ && qtdemux->segment.start > min_time))
&& qtdemux->streams[index]->on_keyframe)) {
GST_DEBUG_OBJECT (qtdemux, "we reached the end of our segment.");
qtdemux->streams[index]->time_position = -1;
diff --git a/gst/level/gstlevel.c b/gst/level/gstlevel.c
index 59943d48..5cd83c84 100644
--- a/gst/level/gstlevel.c
+++ b/gst/level/gstlevel.c
@@ -95,9 +95,9 @@
*
* <refsect2>
* <title>Example application</title>
- * |[
+ * <informalexample><programlisting language="C">
* <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" parse="text" href="../../../../tests/examples/level/level-example.c" />
- * ]|
+ * </programlisting></informalexample>
* </refsect2>
*/
diff --git a/gst/rtp/gstrtpamrdepay.c b/gst/rtp/gstrtpamrdepay.c
index e1208bfa..4c6b7224 100644
--- a/gst/rtp/gstrtpamrdepay.c
+++ b/gst/rtp/gstrtpamrdepay.c
@@ -78,7 +78,8 @@ static GstStaticPadTemplate gst_rtp_amr_depay_sink_template =
"media = (string) \"audio\", "
"clock-rate = (int) 8000, "
"encoding-name = (string) \"AMR\", "
- "encoding-params = (string) \"1\", "
+ /* This is the default, so the peer doesn't have to specify it
+ * "encoding-params = (string) \"1\", " */
/* NOTE that all values must be strings in orde to be able to do SDP <->
* GstCaps mapping. */
"octet-align = (string) \"1\";"
@@ -97,7 +98,8 @@ static GstStaticPadTemplate gst_rtp_amr_depay_sink_template =
"media = (string) \"audio\", "
"clock-rate = (int) 16000, "
"encoding-name = (string) \"AMR-WB\", "
- "encoding-params = (string) \"1\", "
+ /* This is the default, so the peer doesn't have to specify it
+ * "encoding-params = (string) \"1\", " */
/* NOTE that all values must be strings in orde to be able to do SDP <->
* GstCaps mapping. */
"octet-align = (string) \"1\";"
diff --git a/gst/rtp/gstrtph264depay.c b/gst/rtp/gstrtph264depay.c
index 91432b57..a7b52bda 100644
--- a/gst/rtp/gstrtph264depay.c
+++ b/gst/rtp/gstrtph264depay.c
@@ -712,29 +712,35 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
if (rtph264depay->merge) {
gboolean start = FALSE, complete = FALSE;
- /* consider a coded slices (IDR or not) to start a picture,
- * (so ending the previous one) if first_mb_in_slice == 0
- * (non-0 is part of previous one) */
- /* NOTE this is not entirely according to Access Unit specs in 7.4.1.2.4,
- * but in practice it works in sane cases, needs not much parsing,
- * and also works with broken frame_num in NAL (where spec-wise would fail) */
- if (nal_type == 1 || nal_type == 2 || nal_type == 5) {
- /* we have a picture start */
- start = TRUE;
- if (map.data[5] & 0x80) {
- /* first_mb_in_slice == 0 completes a picture */
+ /* marker bit isn't mandatory so in the following code we try to guess
+ * an AU boundary by detecting a new picture start */
+ if (!marker) {
+ /* consider a coded slices (IDR or not) to start a picture,
+ * (so ending the previous one) if first_mb_in_slice == 0
+ * (non-0 is part of previous one) */
+ /* NOTE this is not entirely according to Access Unit specs in 7.4.1.2.4,
+ * but in practice it works in sane cases, needs not much parsing,
+ * and also works with broken frame_num in NAL (where spec-wise would fail) */
+ /* FIXME: this code isn't correct for interlaced content as AUs should be
+ * constructed with pairs of fields and the guess here will just push out
+ * AUs with a single field in it */
+ if (nal_type == 1 || nal_type == 2 || nal_type == 5) {
+ /* we have a picture start */
+ start = TRUE;
+ if (map.data[5] & 0x80) {
+ /* first_mb_in_slice == 0 completes a picture */
+ complete = TRUE;
+ }
+ } else if (nal_type >= 6 && nal_type <= 9) {
+ /* SEI, SPS, PPS, AU terminate picture */
complete = TRUE;
}
- } else if (nal_type >= 6 && nal_type <= 9) {
- /* SEI, SPS, PPS, AU terminate picture */
- complete = TRUE;
- }
- GST_DEBUG_OBJECT (depayload, "start %d, complete %d", start, complete);
-
- if (complete && rtph264depay->picture_start)
- outbuf = gst_rtp_h264_complete_au (rtph264depay, &out_timestamp,
- &out_keyframe);
+ GST_DEBUG_OBJECT (depayload, "start %d, complete %d", start, complete);
+ if (complete && rtph264depay->picture_start)
+ outbuf = gst_rtp_h264_complete_au (rtph264depay, &out_timestamp,
+ &out_keyframe);
+ }
/* add to adapter */
gst_buffer_unmap (nal, &map);
diff --git a/gst/rtp/gstrtpilbcdepay.c b/gst/rtp/gstrtpilbcdepay.c
index 8b4285e1..5c7dc254 100644
--- a/gst/rtp/gstrtpilbcdepay.c
+++ b/gst/rtp/gstrtpilbcdepay.c
@@ -49,8 +49,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS ("application/x-rtp, "
"media = (string) \"audio\", "
"clock-rate = (int) 8000, "
- "encoding-name = (string) \"ILBC\", "
- "mode = (string) { \"20\", \"30\" }")
+ "encoding-name = (string) \"ILBC\"")
+ /* "mode = (string) { \"20\", \"30\" }" */
);
static GstStaticPadTemplate gst_rtp_ilbc_depay_src_template =
diff --git a/gst/rtp/gstrtpjpegpay.c b/gst/rtp/gstrtpjpegpay.c
index 91bd54c5..227d8ddb 100644
--- a/gst/rtp/gstrtpjpegpay.c
+++ b/gst/rtp/gstrtpjpegpay.c
@@ -813,10 +813,16 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload,
do {
GstBuffer *outbuf;
guint8 *payload;
- guint payload_size = (bytes_left < mtu ? bytes_left : mtu);
+ guint payload_size;
guint header_size;
GstBuffer *paybuf;
GstRTPBuffer rtp = { NULL };
+ guint rtp_header_size = gst_rtp_buffer_calc_header_len (0);
+
+ /* The available room is the packet MTU, minus the RTP header length. */
+ payload_size =
+ (bytes_left < (mtu - rtp_header_size) ? bytes_left :
+ (mtu - rtp_header_size));
header_size = sizeof (jpeg_header) + quant_data_size;
if (dri_found)
diff --git a/gst/rtp/gstrtpsirendepay.c b/gst/rtp/gstrtpsirendepay.c
index 9d1e1ef6..1bbbda78 100644
--- a/gst/rtp/gstrtpsirendepay.c
+++ b/gst/rtp/gstrtpsirendepay.c
@@ -35,7 +35,9 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS ("application/x-rtp, "
"media = (string) \"audio\", "
"clock-rate = (int) 16000, "
- "encoding-name = (string) \"SIREN\", " "dct-length = (int) 320")
+ "encoding-name = (string) \"SIREN\"")
+ /* This is the default, so the peer doesn't have to specify it */
+ /* " "dct-length = (int) 320") */
);
static GstStaticPadTemplate gst_rtp_siren_depay_src_template =
diff --git a/gst/rtp/gstrtpspeexdepay.c b/gst/rtp/gstrtpspeexdepay.c
index 97250a76..34aef390 100644
--- a/gst/rtp/gstrtpspeexdepay.c
+++ b/gst/rtp/gstrtpspeexdepay.c
@@ -46,8 +46,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS ("application/x-rtp, "
"media = (string) \"audio\", "
"clock-rate = (int) [6000, 48000], "
- "encoding-name = (string) \"SPEEX\", "
- "encoding-params = (string) \"1\"")
+ "encoding-name = (string) \"SPEEX\"")
+ /* "encoding-params = (string) \"1\"" */
);
static GstStaticPadTemplate gst_rtp_speex_depay_src_template =
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index 2529f2bb..a0e4aad3 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -250,6 +250,7 @@ struct _GstRtpJitterBufferPrivate
/* state */
gboolean eos;
+ guint last_percent;
/* clock rate and rtp timestamp offset */
gint last_pt;
@@ -1124,6 +1125,7 @@ gst_rtp_jitter_buffer_flush_stop (GstRtpJitterBuffer * jitterbuffer)
priv->ext_timestamp = -1;
GST_DEBUG_OBJECT (jitterbuffer, "flush and reset jitterbuffer");
rtp_jitter_buffer_flush (priv->jbuf, (GFunc) free_item, NULL);
+ rtp_jitter_buffer_disable_buffering (priv->jbuf, FALSE);
rtp_jitter_buffer_reset_skew (priv->jbuf);
remove_all_timers (jitterbuffer);
JBUF_UNLOCK (priv);
@@ -1354,6 +1356,7 @@ gst_rtp_jitter_buffer_sink_event (GstPad * pad, GstObject * parent,
if (ret && !priv->eos) {
GST_INFO_OBJECT (jitterbuffer, "queuing EOS");
priv->eos = TRUE;
+ rtp_jitter_buffer_disable_buffering (priv->jbuf, TRUE);
JBUF_SIGNAL_EVENT (priv);
} else if (priv->eos) {
GST_DEBUG_OBJECT (jitterbuffer, "dropping EOS, we are already EOS");
@@ -1472,31 +1475,24 @@ parse_failed:
}
/* call with jbuf lock held */
-static void
-check_buffering_percent (GstRtpJitterBuffer * jitterbuffer, gint * percent)
+static GstMessage *
+check_buffering_percent (GstRtpJitterBuffer * jitterbuffer, gint percent)
{
GstRtpJitterBufferPrivate *priv = jitterbuffer->priv;
+ GstMessage *message = NULL;
- /* too short a stream, or too close to EOS will never really fill buffer */
- if (*percent != -1 && priv->npt_stop != -1 &&
- priv->npt_stop - priv->npt_start <=
- rtp_jitter_buffer_get_delay (priv->jbuf)) {
- GST_DEBUG_OBJECT (jitterbuffer, "short stream; faking full buffer");
- rtp_jitter_buffer_set_buffering (priv->jbuf, FALSE);
- *percent = 100;
- }
-}
-
-static void
-post_buffering_percent (GstRtpJitterBuffer * jitterbuffer, gint percent)
-{
- GstMessage *message;
+ if (percent == -1)
+ return NULL;
/* Post a buffering message */
- message = gst_message_new_buffering (GST_OBJECT_CAST (jitterbuffer), percent);
- gst_message_set_buffering_stats (message, GST_BUFFERING_LIVE, -1, -1, -1);
+ if (priv->last_percent != percent) {
+ priv->last_percent = percent;
+ message =
+ gst_message_new_buffering (GST_OBJECT_CAST (jitterbuffer), percent);
+ gst_message_set_buffering_stats (message, GST_BUFFERING_LIVE, -1, -1, -1);
+ }
- gst_element_post_message (GST_ELEMENT_CAST (jitterbuffer), message);
+ return message;
}
static GstClockTime
@@ -1916,6 +1912,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
gboolean do_next_seqnum = FALSE;
RTPJitterBufferItem *item;
+ GstMessage *msg = NULL;
jitterbuffer = GST_RTP_JITTER_BUFFER (parent);
@@ -2117,13 +2114,13 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
GST_DEBUG_OBJECT (jitterbuffer, "Pushed packet #%d, now %d packets, tail: %d",
seqnum, rtp_jitter_buffer_num_packets (priv->jbuf), tail);
- check_buffering_percent (jitterbuffer, &percent);
+ msg = check_buffering_percent (jitterbuffer, percent);
finished:
JBUF_UNLOCK (priv);
- if (percent != -1)
- post_buffering_percent (jitterbuffer, percent);
+ if (msg)
+ gst_element_post_message (GST_ELEMENT_CAST (jitterbuffer), msg);
return ret;
@@ -2207,45 +2204,61 @@ static void
update_estimated_eos (GstRtpJitterBuffer * jitterbuffer,
RTPJitterBufferItem * item)
{
+ guint64 total, elapsed, left, estimated;
+ GstClockTime out_time;
GstRtpJitterBufferPrivate *priv = jitterbuffer->priv;
- if (priv->npt_stop != -1 && priv->ext_timestamp != -1
- && priv->clock_base != -1 && priv->clock_rate > 0) {
- guint64 elapsed, estimated;
-
- elapsed = compute_elapsed (jitterbuffer, item);
-
- if (elapsed > priv->last_elapsed || !priv->last_elapsed) {
- guint64 left;
- GstClockTime out_time;
+ if (priv->npt_stop == -1 || priv->ext_timestamp == -1
+ || priv->clock_base == -1 || priv->clock_rate <= 0)
+ return;
- priv->last_elapsed = elapsed;
+ /* compute the elapsed time */
+ elapsed = compute_elapsed (jitterbuffer, item);
- left = priv->npt_stop - priv->npt_start;
- GST_LOG_OBJECT (jitterbuffer, "left %" GST_TIME_FORMAT,
- GST_TIME_ARGS (left));
+ /* do nothing if elapsed time doesn't increment */
+ if (priv->last_elapsed && elapsed <= priv->last_elapsed)
+ return;
- out_time = item->dts;
+ priv->last_elapsed = elapsed;
- if (elapsed > 0)
- estimated = gst_util_uint64_scale (out_time, left, elapsed);
- else {
- /* if there is almost nothing left,
- * we may never advance enough to end up in the above case */
- if (left < GST_SECOND)
- estimated = GST_SECOND;
- else
- estimated = -1;
- }
+ /* this is the total time we need to play */
+ total = priv->npt_stop - priv->npt_start;
+ GST_LOG_OBJECT (jitterbuffer, "total %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (total));
- GST_LOG_OBJECT (jitterbuffer, "elapsed %" GST_TIME_FORMAT ", estimated %"
- GST_TIME_FORMAT, GST_TIME_ARGS (elapsed), GST_TIME_ARGS (estimated));
+ /* this is how much time there is left */
+ if (total > elapsed)
+ left = total - elapsed;
+ else
+ left = 0;
+
+ /* if we have less time left that the size of the buffer, we will not
+ * be able to keep it filled, disabled buffering then */
+ if (left < rtp_jitter_buffer_get_delay (priv->jbuf)) {
+ GST_DEBUG_OBJECT (jitterbuffer, "left %" GST_TIME_FORMAT
+ ", disable buffering close to EOS", GST_TIME_ARGS (left));
+ rtp_jitter_buffer_disable_buffering (priv->jbuf, TRUE);
+ }
+
+ /* this is the current time as running-time */
+ out_time = item->dts;
+
+ if (elapsed > 0)
+ estimated = gst_util_uint64_scale (out_time, total, elapsed);
+ else {
+ /* if there is almost nothing left,
+ * we may never advance enough to end up in the above case */
+ if (total < GST_SECOND)
+ estimated = GST_SECOND;
+ else
+ estimated = -1;
+ }
+ GST_LOG_OBJECT (jitterbuffer, "elapsed %" GST_TIME_FORMAT ", estimated %"
+ GST_TIME_FORMAT, GST_TIME_ARGS (elapsed), GST_TIME_ARGS (estimated));
- if (estimated != -1 && priv->estimated_eos != estimated) {
- set_timer (jitterbuffer, TIMER_TYPE_EOS, -1, estimated);
- priv->estimated_eos = estimated;
- }
- }
+ if (estimated != -1 && priv->estimated_eos != estimated) {
+ set_timer (jitterbuffer, TIMER_TYPE_EOS, -1, estimated);
+ priv->estimated_eos = estimated;
}
}
@@ -2261,6 +2274,7 @@ pop_and_push_next (GstRtpJitterBuffer * jitterbuffer, guint16 seqnum)
GstClockTime dts, pts;
gint percent = -1;
gboolean is_buffer, do_push = TRUE;
+ GstMessage *msg;
/* when we get here we are ready to pop and push the buffer */
item = rtp_jitter_buffer_pop (priv->jbuf, &percent);
@@ -2268,8 +2282,6 @@ pop_and_push_next (GstRtpJitterBuffer * jitterbuffer, guint16 seqnum)
is_buffer = GST_IS_BUFFER (item->data);
if (is_buffer) {
- check_buffering_percent (jitterbuffer, &percent);
-
/* we need to make writable to change the flags and timestamps */
outbuf = gst_buffer_make_writable (item->data);
@@ -2309,16 +2321,18 @@ pop_and_push_next (GstRtpJitterBuffer * jitterbuffer, guint16 seqnum)
* so the other end can push stuff in the queue again. */
priv->last_popped_seqnum = seqnum;
priv->next_seqnum = (seqnum + item->count) & 0xffff;
+
+ msg = check_buffering_percent (jitterbuffer, percent);
JBUF_UNLOCK (priv);
item->data = NULL;
free_item (item);
+ if (msg)
+ gst_element_post_message (GST_ELEMENT_CAST (jitterbuffer), msg);
+
if (is_buffer) {
/* push buffer */
- if (percent != -1)
- post_buffering_percent (jitterbuffer, percent);
-
GST_DEBUG_OBJECT (jitterbuffer,
"Pushing buffer %d, dts %" GST_TIME_FORMAT ", pts %" GST_TIME_FORMAT,
seqnum, GST_TIME_ARGS (GST_BUFFER_DTS (outbuf)),
@@ -2537,6 +2551,11 @@ do_eos_timeout (GstRtpJitterBuffer * jitterbuffer, TimerData * timer,
GST_INFO_OBJECT (jitterbuffer, "got the NPT timeout");
remove_timer (jitterbuffer, timer);
+ if (!priv->eos) {
+ /* there was no EOS in the buffer, assume there is now */
+ priv->eos = TRUE;
+ rtp_jitter_buffer_disable_buffering (priv->jbuf, TRUE);
+ }
JBUF_SIGNAL_EVENT (priv);
return TRUE;
diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c
index 67c3efcf..e82c0bd2 100644
--- a/gst/rtpmanager/rtpjitterbuffer.c
+++ b/gst/rtpmanager/rtpjitterbuffer.c
@@ -224,6 +224,19 @@ rtp_jitter_buffer_reset_skew (RTPJitterBuffer * jbuf)
GST_DEBUG ("reset skew correction");
}
+/**
+ * rtp_jitter_buffer_disable_buffering:
+ * @jbuf: an #RTPJitterBuffer
+ * @disabled: the new state
+ *
+ * Enable or disable buffering on @jbuf.
+ */
+void
+rtp_jitter_buffer_disable_buffering (RTPJitterBuffer * jbuf, gboolean disabled)
+{
+ jbuf->buffering_disabled = disabled;
+}
+
static void
rtp_jitter_buffer_resync (RTPJitterBuffer * jbuf, GstClockTime time,
GstClockTime gstrtptime, guint64 ext_rtptime, gboolean reset_skew)
@@ -295,9 +308,14 @@ update_buffer_level (RTPJitterBuffer * jbuf, gint * percent)
level = get_buffer_level (jbuf);
GST_DEBUG ("buffer level %" GST_TIME_FORMAT, GST_TIME_ARGS (level));
+ if (jbuf->buffering_disabled) {
+ GST_DEBUG ("buffering is disabled");
+ level = jbuf->high_level;
+ }
+
if (jbuf->buffering) {
post = TRUE;
- if (level > jbuf->high_level) {
+ if (level >= jbuf->high_level) {
GST_DEBUG ("buffering finished");
jbuf->buffering = FALSE;
}
@@ -839,7 +857,7 @@ rtp_jitter_buffer_flush (RTPJitterBuffer * jbuf, GFunc free_func,
gboolean
rtp_jitter_buffer_is_buffering (RTPJitterBuffer * jbuf)
{
- return jbuf->buffering;
+ return jbuf->buffering && !jbuf->buffering_disabled;
}
/**
@@ -872,6 +890,9 @@ rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf)
if (G_UNLIKELY (jbuf->high_level == 0))
return 100;
+ if (G_UNLIKELY (jbuf->buffering_disabled))
+ return 100;
+
level = get_buffer_level (jbuf);
percent = (level * 100 / jbuf->high_level);
percent = MIN (percent, 100);
diff --git a/gst/rtpmanager/rtpjitterbuffer.h b/gst/rtpmanager/rtpjitterbuffer.h
index 1389f268..96cf842d 100644
--- a/gst/rtpmanager/rtpjitterbuffer.h
+++ b/gst/rtpmanager/rtpjitterbuffer.h
@@ -94,6 +94,7 @@ struct _RTPJitterBuffer {
gint64 window_min;
gint64 skew;
gint64 prev_send_diff;
+ gboolean buffering_disabled;
};
struct _RTPJitterBufferClass {
@@ -145,6 +146,9 @@ void rtp_jitter_buffer_reset_skew (RTPJitterBuffer *jbuf)
gboolean rtp_jitter_buffer_insert (RTPJitterBuffer *jbuf,
RTPJitterBufferItem *item,
gboolean *tail, gint *percent);
+
+void rtp_jitter_buffer_disable_buffering (RTPJitterBuffer *jbuf, gboolean disabled);
+
RTPJitterBufferItem * rtp_jitter_buffer_peek (RTPJitterBuffer *jbuf);
RTPJitterBufferItem * rtp_jitter_buffer_pop (RTPJitterBuffer *jbuf, gint *percent);
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index 336e194d..6720315b 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -2195,6 +2195,9 @@ rtp_session_process_fir (RTPSession * sess, guint32 sender_ssrc,
ssrc = GST_READ_UINT32_BE (data);
own = find_source (sess, ssrc);
+ if (own == NULL)
+ continue;
+
if (own->internal) {
our_request = TRUE;
break;
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 0e835a47..adeb440f 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -7066,6 +7066,7 @@ gst_rtspsrc_start (GstRTSPSrc * src)
/* ERRORS */
task_error:
{
+ GST_OBJECT_UNLOCK (src);
GST_ERROR_OBJECT (src, "failed to create task");
return FALSE;
}
diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c
index 75a9152b..5e192c16 100644
--- a/gst/spectrum/gstspectrum.c
+++ b/gst/spectrum/gstspectrum.c
@@ -90,9 +90,9 @@
*
* <refsect2>
* <title>Example application</title>
- * |[
+ * <informalexample><programlisting language="C">
* <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" parse="text" href="../../../../tests/examples/spectrum/spectrum-example.c" />
- * ]|
+ * </programlisting></informalexample>
* </refsect2>
*
* Last reviewed on 2011-03-10 (0.10.29)
diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c
index 922e381d..ea49af94 100644
--- a/gst/udp/gstudpsrc.c
+++ b/gst/udp/gstudpsrc.c
@@ -78,8 +78,7 @@
* </itemizedlist>
* The message is typically used to detect that no UDP arrives in the receiver
* because it is blocked by a firewall.
- * </para>
- * <para>
+ *
* A custom file descriptor can be configured with the
* #GstUDPSrc:sockfd property. The socket will be closed when setting the
* element to READY by default. This behaviour can be