From 12c680d38febad6fd78dcb60ff622eca558fffef Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 24 Jun 2011 14:49:36 -0500 Subject: [PATCH] fix video read frame function to behave like the audio one when waiting for codecs --- src/mod/endpoints/mod_sofia/mod_sofia.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index fcd4f56a38..7d2164548f 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -816,6 +816,7 @@ static switch_status_t sofia_read_video_frame(switch_core_session_t *session, sw { private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session); switch_channel_t *channel = switch_core_session_get_channel(session); + uint32_t sanity = 1000; switch_assert(tech_pvt != NULL); @@ -823,10 +824,13 @@ static switch_status_t sofia_read_video_frame(switch_core_session_t *session, sw return SWITCH_STATUS_FALSE; } - while (!(tech_pvt->video_read_codec.implementation && switch_rtp_ready(tech_pvt->video_rtp_session))) { - if (switch_channel_ready(channel)) { + while (!(tech_pvt->video_read_codec.implementation && switch_rtp_ready(tech_pvt->video_rtp_session) && !switch_channel_test_flag(channel, CF_REQ_MEDIA))) { + switch_ivr_parse_all_messages(tech_pvt->session); + + if (--sanity && switch_channel_ready(channel)) { switch_yield(10000); } else { + switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE); return SWITCH_STATUS_GENERR; } }