]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5513 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 19 Jun 2013 02:16:48 +0000 (21:16 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 19 Jun 2013 02:16:56 +0000 (21:16 -0500)
src/include/switch_core_media.h
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_core_media.c

index 6379a88e6f4d1ce258169f2449c3ee9a6e39d957..84837382860910fbc534f95d15a30184023bef92 100644 (file)
@@ -144,8 +144,6 @@ typedef struct switch_core_media_params_s {
 
        char *sdp_username;
 
-       switch_mutex_t *mutex;
-
        switch_payload_t te;
        switch_payload_t recv_te;
 
index 65b1984543ea366054b766813ffa41eed84824b0..c99cd91068d17edabcdf400965b6c9575961948f 100644 (file)
@@ -156,7 +156,6 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
        tech_pvt->mparams.extsipip = profile->extsipip;
        tech_pvt->mparams.extrtpip = profile->extrtpip;
        tech_pvt->mparams.local_network = profile->local_network;
-       tech_pvt->mparams.mutex = tech_pvt->sofia_mutex;
        tech_pvt->mparams.sipip = profile->sipip;
        tech_pvt->mparams.jb_msec = profile->jb_msec;
        tech_pvt->mparams.rtcp_audio_interval_msec = profile->rtcp_audio_interval_msec;
index eb2f2eccf5ff8b8f1da87475be7dc9789ff27cff..97ad76116782a4a95c60f038735c35dc04bd5857 100644 (file)
@@ -174,7 +174,7 @@ struct switch_media_handle_s {
        int payload_space;
        char *origin;
 
-
+       switch_mutex_t *mutex;
 
        const switch_codec_implementation_t *negotiated_codecs[SWITCH_MAX_CODECS];
        int num_negotiated_codecs;
@@ -1036,6 +1036,8 @@ SWITCH_DECLARE(switch_status_t) switch_media_handle_create(switch_media_handle_t
                session->media_handle->engines[SWITCH_MEDIA_TYPE_VIDEO].read_frame.buflen = SWITCH_RTP_MAX_BUF_LEN;
                session->media_handle->mparams = params;
 
+               switch_mutex_init(&session->media_handle->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
+
                session->media_handle->engines[SWITCH_MEDIA_TYPE_AUDIO].ssrc = 
                        (uint32_t) ((intptr_t) &session->media_handle->engines[SWITCH_MEDIA_TYPE_AUDIO] + (uint32_t) time(NULL));
 
@@ -5022,10 +5024,10 @@ SWITCH_DECLARE(void)switch_core_media_set_local_sdp(switch_core_session_t *sessi
                return;
        }
 
-       if (smh->mparams->mutex) switch_mutex_lock(smh->mparams->mutex);
+       if (smh->mutex) switch_mutex_lock(smh->mutex);
        smh->mparams->local_sdp_str = dup ? switch_core_session_strdup(session, sdp_str) : (char *) sdp_str;
        switch_channel_set_variable(session->channel, "rtp_local_sdp_str", smh->mparams->local_sdp_str);
-       if (smh->mparams->mutex) switch_mutex_unlock(smh->mparams->mutex);
+       if (smh->mutex) switch_mutex_unlock(smh->mutex);
 }
 
 
@@ -6612,7 +6614,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
        }
 
 
-       if (smh->mparams->mutex) switch_mutex_lock(smh->mparams->mutex);
+       if (smh->mutex) switch_mutex_lock(smh->mutex);
 
 
        if (switch_channel_down(session->channel)) {
@@ -6698,7 +6700,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
 
  end_lock:
 
-       if (smh->mparams->mutex) switch_mutex_unlock(smh->mparams->mutex);
+       if (smh->mutex) switch_mutex_unlock(smh->mutex);
 
  end: