mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
rtsession: fix locking
We need to take the session lock when getting and manipulating the source.
This commit is contained in:
parent
3f46527f75
commit
4b7bcc2ec1
1 changed files with 24 additions and 4 deletions
|
@ -3589,10 +3589,12 @@ gboolean
|
||||||
rtp_session_request_key_unit (RTPSession * sess, guint32 ssrc,
|
rtp_session_request_key_unit (RTPSession * sess, guint32 ssrc,
|
||||||
gboolean fir, gint count)
|
gboolean fir, gint count)
|
||||||
{
|
{
|
||||||
RTPSource *src = find_source (sess, ssrc);
|
RTPSource *src;
|
||||||
|
|
||||||
|
RTP_SESSION_LOCK (sess);
|
||||||
|
src = find_source (sess, ssrc);
|
||||||
if (!src)
|
if (!src)
|
||||||
return FALSE;
|
goto no_source;
|
||||||
|
|
||||||
if (fir) {
|
if (fir) {
|
||||||
src->send_pli = FALSE;
|
src->send_pli = FALSE;
|
||||||
|
@ -3604,10 +3606,18 @@ rtp_session_request_key_unit (RTPSession * sess, guint32 ssrc,
|
||||||
} else if (!src->send_fir) {
|
} else if (!src->send_fir) {
|
||||||
src->send_pli = TRUE;
|
src->send_pli = TRUE;
|
||||||
}
|
}
|
||||||
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
|
||||||
rtp_session_send_rtcp (sess, 200 * GST_MSECOND);
|
rtp_session_send_rtcp (sess, 200 * GST_MSECOND);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
no_source:
|
||||||
|
{
|
||||||
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3625,15 +3635,25 @@ gboolean
|
||||||
rtp_session_request_nack (RTPSession * sess, guint32 ssrc, guint16 seqnum,
|
rtp_session_request_nack (RTPSession * sess, guint32 ssrc, guint16 seqnum,
|
||||||
GstClockTime max_delay)
|
GstClockTime max_delay)
|
||||||
{
|
{
|
||||||
RTPSource *source = find_source (sess, ssrc);
|
RTPSource *source;
|
||||||
|
|
||||||
|
RTP_SESSION_LOCK (sess);
|
||||||
|
source = find_source (sess, ssrc);
|
||||||
if (source == NULL)
|
if (source == NULL)
|
||||||
return FALSE;
|
goto no_source;
|
||||||
|
|
||||||
GST_DEBUG ("request NACK for %08x, #%u", ssrc, seqnum);
|
GST_DEBUG ("request NACK for %08x, #%u", ssrc, seqnum);
|
||||||
rtp_source_register_nack (source, seqnum);
|
rtp_source_register_nack (source, seqnum);
|
||||||
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
|
||||||
rtp_session_send_rtcp (sess, max_delay);
|
rtp_session_send_rtcp (sess, max_delay);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
no_source:
|
||||||
|
{
|
||||||
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue