From: Anthony Minessale Date: Mon, 22 Feb 2016 19:31:16 +0000 (-0600) Subject: FS-8842 #comment please try this patch on latest master X-Git-Tag: v1.6.7~2^2~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0657a82e0a730cccb3a2480d389eea53de5f07e;p=thirdparty%2Ffreeswitch.git FS-8842 #comment please try this patch on latest master --- diff --git a/src/switch_core_media.c b/src/switch_core_media.c index eb06f73207..9183848283 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -2117,10 +2117,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session return SWITCH_STATUS_FALSE; } - if (switch_channel_test_flag(session->channel, CF_LEG_HOLDING)) { - return SWITCH_STATUS_INUSE; - } - if (smh->read_mutex[type] && switch_mutex_trylock(smh->read_mutex[type]) != SWITCH_STATUS_SUCCESS) { /* return CNG, another thread is already reading */ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG1, "%s is already being read for %s\n", @@ -2155,6 +2151,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session goto end; } + if (switch_channel_test_flag(session->channel, CF_LEG_HOLDING)) { + status = SWITCH_STATUS_INUSE; + goto end; + } + if (type == SWITCH_MEDIA_TYPE_VIDEO && engine->read_frame.m) { if (!smh->vid_started) { smh->vid_started = switch_epoch_time_now(NULL);