summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.decina@collabora.co.uk>2010-05-03 11:56:58 +0200
committerAlessandro Decina <alessandro.decina@collabora.co.uk>2010-05-03 11:56:58 +0200
commitffc2da30fc4bedef6333c8184710802b870995d7 (patch)
treebed04db200a76c398b19791dbb82ebacdf9a2a59
parentf6e9f359b9bc06febc6297c113ddfbb53234a525 (diff)
rtpbin: fix a bug handling BUFFERING messages.
If a session exists but has no streams, set the min buffering percent to 0 since it means that we haven't received anything for that session yet.
-rw-r--r--gst/rtpmanager/gstrtpbin.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c
index 38f703227..4d38dbfd9 100644
--- a/gst/rtpmanager/gstrtpbin.c
+++ b/gst/rtpmanager/gstrtpbin.c
@@ -1804,16 +1804,22 @@ gst_rtp_bin_handle_message (GstBin * bin, GstMessage * message)
GstRtpBinSession *session = (GstRtpBinSession *) sessions->data;
GST_RTP_SESSION_LOCK (session);
- for (streams = session->streams; streams;
- streams = g_slist_next (streams)) {
- GstRtpBinStream *stream = (GstRtpBinStream *) streams->data;
+ if (session->streams) {
+ for (streams = session->streams; streams;
+ streams = g_slist_next (streams)) {
+ GstRtpBinStream *stream = (GstRtpBinStream *) streams->data;
- GST_DEBUG_OBJECT (bin, "stream %p percent %d", stream,
- stream->percent);
+ GST_DEBUG_OBJECT (bin, "stream %p percent %d", stream,
+ stream->percent);
- /* find min percent */
- if (min_percent > stream->percent)
- min_percent = stream->percent;
+ /* find min percent */
+ if (min_percent > stream->percent)
+ min_percent = stream->percent;
+ }
+ } else {
+ GST_INFO_OBJECT (bin,
+ "session has no streams, setting min_percent to 0");
+ min_percent = 0;
}
GST_RTP_SESSION_UNLOCK (session);
}