try to improve audio stream sync

This commit is contained in:
Anthony Minessale
2012-11-28 23:12:35 -06:00
parent f1a89fb016
commit d4f8a79299
7 changed files with 62 additions and 33 deletions
+11 -1
View File
@@ -1565,7 +1565,17 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if (switch_core_session_in_thread(session)) {
de->session = session;
}
sofia_process_dispatch_event(&de);
if (de->data->e_event == nua_i_cancel || de->data->e_event == nua_i_bye) {
sofia_set_flag(tech_pvt, TFLAG_SIGDEAD);
}
if (!sofia_test_flag(tech_pvt, TFLAG_SIGDEAD) && (switch_channel_media_up(channel) || switch_channel_get_state(channel) > CS_ROUTING)) {
sofia_queue_message(de);
} else {
sofia_process_dispatch_event(&de);
}
switch_mutex_unlock(tech_pvt->sofia_mutex);
goto end;
}
+3
View File
@@ -353,6 +353,7 @@ typedef enum {
TFLAG_PASS_ACK,
TFLAG_CRYPTO_RECOVER,
TFLAG_DROP_DTMF,
TFLAG_SIGDEAD,
/* No new flags below this line */
TFLAG_MAX
} TFLAGS;
@@ -1205,6 +1206,7 @@ void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np);
void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t on);
void sofia_process_dispatch_event(sofia_dispatch_event_t **dep);
void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep);
char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool);
void sofia_presence_check_subscriptions(sofia_profile_t *profile, time_t now);
void sofia_msg_thread_start(int idx);
@@ -1215,6 +1217,7 @@ private_object_t *sofia_glue_new_pvt(switch_core_session_t *session);
switch_status_t sofia_init(void);
void sofia_glue_fire_events(sofia_profile_t *profile);
void sofia_event_fire(sofia_profile_t *profile, switch_event_t **event);
void sofia_queue_message(sofia_dispatch_event_t *de);
/* For Emacs:
* Local Variables:
+1 -1
View File
@@ -1686,7 +1686,7 @@ void sofia_msg_thread_start(int idx)
}
//static int foo = 0;
static void sofia_queue_message(sofia_dispatch_event_t *de)
void sofia_queue_message(sofia_dispatch_event_t *de)
{
int launch = 0;