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.
This commit is contained in:
Alessandro Decina 2010-05-03 11:56:58 +02:00
parent f6e9f359b9
commit ffc2da30fc

View file

@ -1804,6 +1804,7 @@ gst_rtp_bin_handle_message (GstBin * bin, GstMessage * message)
GstRtpBinSession *session = (GstRtpBinSession *) sessions->data; GstRtpBinSession *session = (GstRtpBinSession *) sessions->data;
GST_RTP_SESSION_LOCK (session); GST_RTP_SESSION_LOCK (session);
if (session->streams) {
for (streams = session->streams; streams; for (streams = session->streams; streams;
streams = g_slist_next (streams)) { streams = g_slist_next (streams)) {
GstRtpBinStream *stream = (GstRtpBinStream *) streams->data; GstRtpBinStream *stream = (GstRtpBinStream *) streams->data;
@ -1815,6 +1816,11 @@ gst_rtp_bin_handle_message (GstBin * bin, GstMessage * message)
if (min_percent > stream->percent) if (min_percent > stream->percent)
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); GST_RTP_SESSION_UNLOCK (session);
} }
GST_DEBUG_OBJECT (bin, "min percent %d", min_percent); GST_DEBUG_OBJECT (bin, "min percent %d", min_percent);