mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-09 16:02:59 +00:00
rtpsession: small cleanups
This commit is contained in:
parent
0da5cf2e21
commit
5690331c9e
1 changed files with 10 additions and 7 deletions
|
@ -752,19 +752,23 @@ rtcp_thread (GstRtpSession * rtpsession)
|
||||||
GstClockTime next_timeout;
|
GstClockTime next_timeout;
|
||||||
guint64 ntpnstime;
|
guint64 ntpnstime;
|
||||||
GstClockTime running_time;
|
GstClockTime running_time;
|
||||||
|
RTPSession *session;
|
||||||
|
GstClock *sysclock;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtpsession, "entering RTCP thread");
|
GST_DEBUG_OBJECT (rtpsession, "entering RTCP thread");
|
||||||
|
|
||||||
GST_RTP_SESSION_LOCK (rtpsession);
|
GST_RTP_SESSION_LOCK (rtpsession);
|
||||||
|
|
||||||
current_time = gst_clock_get_time (rtpsession->priv->sysclock);
|
sysclock = rtpsession->priv->sysclock;
|
||||||
|
current_time = gst_clock_get_time (sysclock);
|
||||||
|
|
||||||
|
session = rtpsession->priv->session;
|
||||||
|
|
||||||
while (!rtpsession->priv->stop_thread) {
|
while (!rtpsession->priv->stop_thread) {
|
||||||
GstClockReturn res;
|
GstClockReturn res;
|
||||||
|
|
||||||
/* get initial estimate */
|
/* get initial estimate */
|
||||||
next_timeout =
|
next_timeout = rtp_session_next_timeout (session, current_time);
|
||||||
rtp_session_next_timeout (rtpsession->priv->session, current_time);
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtpsession, "next check time %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (rtpsession, "next check time %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (next_timeout));
|
GST_TIME_ARGS (next_timeout));
|
||||||
|
@ -774,7 +778,7 @@ rtcp_thread (GstRtpSession * rtpsession)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
id = rtpsession->priv->id =
|
id = rtpsession->priv->id =
|
||||||
gst_clock_new_single_shot_id (rtpsession->priv->sysclock, next_timeout);
|
gst_clock_new_single_shot_id (sysclock, next_timeout);
|
||||||
GST_RTP_SESSION_UNLOCK (rtpsession);
|
GST_RTP_SESSION_UNLOCK (rtpsession);
|
||||||
|
|
||||||
res = gst_clock_id_wait (id, NULL);
|
res = gst_clock_id_wait (id, NULL);
|
||||||
|
@ -787,7 +791,7 @@ rtcp_thread (GstRtpSession * rtpsession)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* update current time */
|
/* update current time */
|
||||||
current_time = gst_clock_get_time (rtpsession->priv->sysclock);
|
current_time = gst_clock_get_time (sysclock);
|
||||||
|
|
||||||
/* get current NTP time */
|
/* get current NTP time */
|
||||||
get_current_times (rtpsession, &running_time, &ntpnstime);
|
get_current_times (rtpsession, &running_time, &ntpnstime);
|
||||||
|
@ -799,8 +803,7 @@ rtcp_thread (GstRtpSession * rtpsession)
|
||||||
|
|
||||||
/* perform actions, we ignore result. Release lock because it might push. */
|
/* perform actions, we ignore result. Release lock because it might push. */
|
||||||
GST_RTP_SESSION_UNLOCK (rtpsession);
|
GST_RTP_SESSION_UNLOCK (rtpsession);
|
||||||
rtp_session_on_timeout (rtpsession->priv->session, current_time, ntpnstime,
|
rtp_session_on_timeout (session, current_time, ntpnstime, running_time);
|
||||||
running_time);
|
|
||||||
GST_RTP_SESSION_LOCK (rtpsession);
|
GST_RTP_SESSION_LOCK (rtpsession);
|
||||||
}
|
}
|
||||||
/* mark the thread as stopped now */
|
/* mark the thread as stopped now */
|
||||||
|
|
Loading…
Reference in a new issue