diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-11-14 13:35:20 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-11-14 13:35:20 +0000 |
commit | 5000443f708ddc7821381d4f24e7ce840727d325 (patch) | |
tree | 2d5628b06d9e9caf625134e7e5ebaa61aef7ecdf /pjsip-apps | |
parent | 9115df1d57547f0d3747ddeb048e9ac87c0b9292 (diff) |
Fixed transport detachment when there's no thread being used in siprtp.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@800 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/src/samples/siprtp.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c index 49494b88..4fc236ed 100644 --- a/pjsip-apps/src/samples/siprtp.c +++ b/pjsip-apps/src/samples/siprtp.c @@ -1442,17 +1442,21 @@ static void destroy_call_media(unsigned call_index) { struct media_stream *audio = &app.call[call_index].media[0]; - if (audio->thread) { - + if (audio) { audio->active = PJ_FALSE; - audio->thread_quit_flag = 1; - pj_thread_join(audio->thread); - pj_thread_destroy(audio->thread); - audio->thread = NULL; - audio->thread_quit_flag = 0; + if (audio->thread) { + audio->thread_quit_flag = 1; + pj_thread_join(audio->thread); + pj_thread_destroy(audio->thread); + audio->thread = NULL; + audio->thread_quit_flag = 0; + } - pjmedia_transport_detach(audio->transport, audio); + if (audio->transport) { + pjmedia_transport_detach(audio->transport, audio); + audio->transport = NULL; + } } } |