diff options
author | mannol <eniz_vukovic@hotmail.com> | 2014-07-05 15:11:25 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2014-07-05 15:11:25 +0200 |
commit | 8b9d3992a44fcac66979b847dc2ff488f3ff614a (patch) | |
tree | ae73e54964442d23125a21528e9fb05db294e275 /toxav/rtp.c | |
parent | a8fa360547ccefef3694c5d185414874539769c1 (diff) |
Make rtp & codec actions thread-safe
Diffstat (limited to 'toxav/rtp.c')
-rw-r--r-- | toxav/rtp.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/toxav/rtp.c b/toxav/rtp.c index 9ba3b6a3..39e622bf 100644 --- a/toxav/rtp.c +++ b/toxav/rtp.c | |||
@@ -727,12 +727,9 @@ RTPSession *rtp_init_session ( int payload_type, Messenger *messenger, int frien | |||
727 | * @retval -1 Error occurred. | 727 | * @retval -1 Error occurred. |
728 | * @retval 0 Success. | 728 | * @retval 0 Success. |
729 | */ | 729 | */ |
730 | int rtp_terminate_session ( RTPSession *session, Messenger *messenger ) | 730 | void rtp_terminate_session ( RTPSession *session, Messenger *messenger ) |
731 | { | 731 | { |
732 | if ( !session ) { | 732 | if ( !session ) return; |
733 | LOGGER_WARNING("No session!"); | ||
734 | return -1; | ||
735 | } | ||
736 | 733 | ||
737 | custom_lossy_packet_registerhandler(messenger, session->dest, session->prefix, NULL, NULL); | 734 | custom_lossy_packet_registerhandler(messenger, session->dest, session->prefix, NULL, NULL); |
738 | 735 | ||
@@ -747,8 +744,9 @@ int rtp_terminate_session ( RTPSession *session, Messenger *messenger ) | |||
747 | 744 | ||
748 | pthread_mutex_destroy(&session->mutex); | 745 | pthread_mutex_destroy(&session->mutex); |
749 | 746 | ||
747 | LOGGER_DEBUG("Terminated RTP session: %p", session); | ||
748 | |||
750 | /* And finally free session */ | 749 | /* And finally free session */ |
751 | free ( session ); | 750 | free ( session ); |
752 | 751 | ||
753 | return 0; | ||
754 | } \ No newline at end of file | 752 | } \ No newline at end of file |