Fixed #1541: Crash in third party media sample application after library is restarted

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4174 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2012-06-21 08:09:53 +00:00
parent aecc01cc55
commit 19b542b363
2 changed files with 13 additions and 4 deletions

View File

@ -224,7 +224,7 @@ static void timer_to_send_aud_rtp(void *user_data)
pjsua_call_media *call_med = (pjsua_call_media*) user_data;
const char *pkt = "Not RTP packet";
if (call_med->call->inv == NULL) {
if (!call_med->call || !call_med->call->inv || !call_med->tp) {
/* Call has been disconnected. There is race condition here as
* this cb may be called sometime after call has been disconnected */
return;
@ -240,7 +240,7 @@ static void timer_to_send_aud_rtcp(void *user_data)
pjsua_call_media *call_med = (pjsua_call_media*) user_data;
const char *pkt = "Not RTCP packet";
if (call_med->call->inv == NULL) {
if (!call_med->call || !call_med->call->inv || !call_med->tp) {
/* Call has been disconnected. There is race condition here as
* this cb may be called sometime after call has been disconnected */
return;
@ -301,6 +301,9 @@ on_return:
return status;
}
void pjsua_check_snd_dev_idle()
{
}
/*****************************************************************************
*

View File

@ -234,6 +234,12 @@ pj_status_t pjsua_vid_subsys_start(void)
/* Cleanup and deinitialize the video library */
pj_status_t pjsua_vid_subsys_destroy(void)
{
if (pjmedia_vid_codec_mgr_instance())
pjmedia_vid_codec_mgr_destroy(NULL);
if (pjmedia_video_format_mgr_instance())
pjmedia_video_format_mgr_destroy(NULL);
/*
* TODO: put your 3rd party library cleanup routine here
*/
@ -291,7 +297,7 @@ static void timer_to_send_vid_rtp(void *user_data)
pjsua_call_media *call_med = (pjsua_call_media*) user_data;
const char *pkt = "Not RTP packet";
if (call_med->call->inv == NULL) {
if (!call_med->call || !call_med->call->inv || !call_med->tp) {
/* Call has been disconnected. There is race condition here as
* this cb may be called sometime after call has been disconnected */
return;
@ -307,7 +313,7 @@ static void timer_to_send_vid_rtcp(void *user_data)
pjsua_call_media *call_med = (pjsua_call_media*) user_data;
const char *pkt = "Not RTCP packet";
if (call_med->call->inv == NULL) {
if (!call_med->call || !call_med->call->inv || !call_med->tp) {
/* Call has been disconnected. There is race condition here as
* this cb may be called sometime after call has been disconnected */
return;