Skip to content

Commit

Permalink
Add check for media deinitializing in media init completion callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
nanangizz committed May 22, 2024
1 parent a250942 commit 466cdb3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pjsip/src/pjsua-lib/pjsua_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,12 @@ static pj_status_t call_media_init_cb(pjsua_call_media *call_med,
goto on_return;
}

/* Check if media is deinitializing */
if (call_med->call->async_call.med_ch_deinit || !call_med->tp) {
status = PJ_ECANCELLED;
goto on_return;
}

pjmedia_transport_simulate_lost(call_med->tp, PJMEDIA_DIR_ENCODING,
pjsua_var.media_cfg.tx_drop_pct);

Expand Down

0 comments on commit 466cdb3

Please sign in to comment.