From b645009425b4bdca9b7fb990785b60d9b7c592fb Mon Sep 17 00:00:00 2001 From: smorlat Date: Fri, 5 Jun 2009 16:12:48 +0000 Subject: [PATCH] compute after locking (otherwise we might compute an obsolette time) git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@492 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/oRTP/src/rtpsession.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linphone/oRTP/src/rtpsession.c b/linphone/oRTP/src/rtpsession.c index f6b69da20..be41db30a 100644 --- a/linphone/oRTP/src/rtpsession.c +++ b/linphone/oRTP/src/rtpsession.c @@ -805,13 +805,13 @@ __rtp_session_sendm_with_ts (RtpSession * session, mblk_t *mp, uint32_t packet_t * not block */ if (session->flags & RTP_SESSION_SCHEDULED) { + wait_point_lock(&session->snd.wp); packet_time = rtp_session_ts_to_time (session, send_ts - session->rtp.snd_ts_offset) + session->rtp.snd_time_offset; /*ortp_message("rtp_session_send_with_ts: packet_time=%i time=%i",packet_time,sched->time_);*/ - wait_point_lock(&session->snd.wp); if (TIME_IS_STRICTLY_NEWER_THAN (packet_time, sched->time_)) { wait_point_wakeup_at(&session->snd.wp,packet_time,(session->flags & RTP_SESSION_BLOCKING_MODE)!=0); @@ -1079,13 +1079,14 @@ rtp_session_recvm_with_ts (RtpSession * session, uint32_t user_ts) * wanted expires */ /* but we must not block the process if the timestamp wanted by the application is older * than current time */ + wait_point_lock(&session->rcv.wp); packet_time = rtp_session_ts_to_time (session, user_ts - session->rtp.rcv_query_ts_offset) + session->rtp.rcv_time_offset; ortp_debug ("rtp_session_recvm_with_ts: packet_time=%i, time=%i",packet_time, sched->time_); - wait_point_lock(&session->rcv.wp); + if (TIME_IS_STRICTLY_NEWER_THAN (packet_time, sched->time_)) { wait_point_wakeup_at(&session->rcv.wp,packet_time, (session->flags & RTP_SESSION_BLOCKING_MODE)!=0);