diff --git a/src/rtpstream.cpp b/src/rtpstream.cpp index bf4ea3fe..cbd82415 100644 --- a/src/rtpstream.cpp +++ b/src/rtpstream.cpp @@ -2623,6 +2623,7 @@ void rtpstream_audioecho_thread(void* param) unsigned int host_ssrc = 0; bool abnormal_termination = false; ParamPass p; + quit_audioecho_thread = false; // inicialization tspec.tv_sec = 0; tspec.tv_nsec = 10000000; /* 10ms */ @@ -2712,6 +2713,7 @@ void rtpstream_audioecho_thread(void* param) payload_data.clear(); // DECRYPT + g_rxUASAudio.setSSRC(ntohl(((rtp_header_t*)audio_packet_in.data())->ssrc_id)); // set incoming SSRC id rc = g_rxUASAudio.processIncomingPacket(seq_num, audio_packet_in, rtp_header, payload_data); pthread_mutex_lock(&debugremutexaudio); if (debugrefileaudio != NULL) @@ -2754,6 +2756,7 @@ void rtpstream_audioecho_thread(void* param) memcpy(payload_data.data(), msg.get() + sizeof(rtp_header_t), g_txUASAudio.getSrtpPayloadSize()); // ENCRYPT + g_txUASAudio.setSSRC(ntohl(((rtp_header_t*)audio_packet_in.data())->ssrc_id)); // set incoming SSRC id rc = g_txUASAudio.processOutgoingPacket(seq_num, rtp_header, payload_data, audio_packet_out); pthread_mutex_lock(&debugremutexaudio); if (debugrefileaudio != NULL) @@ -2882,6 +2885,7 @@ void rtpstream_videoecho_thread(void* param) unsigned int host_ssrc = 0; bool abnormal_termination = false; ParamPass p; + quit_audioecho_thread = false; // inicialization tspec.tv_sec = 0; tspec.tv_nsec = 10000000; /* 10ms */ @@ -2970,6 +2974,7 @@ void rtpstream_videoecho_thread(void* param) rtp_header.clear(); payload_data.clear(); // DECRYPT + g_rxUASVideo.setSSRC(ntohl(((rtp_header_t*)video_packet_in.data())->ssrc_id)); // set incoming SSRC id rc = g_rxUASVideo.processIncomingPacket(seq_num, video_packet_in, rtp_header, payload_data); pthread_mutex_lock(&debugremutexvideo); if (debugrefilevideo != NULL) @@ -3012,6 +3017,7 @@ void rtpstream_videoecho_thread(void* param) memcpy(payload_data.data(), msg.get() + sizeof(rtp_header_t), g_txUASVideo.getSrtpPayloadSize()); // ENCRYPT + g_txUASVideo.setSSRC(ntohl(((rtp_header_t*)video_packet_in.data())->ssrc_id)); // set incoming SSRC id rc = g_txUASVideo.processOutgoingPacket(seq_num, rtp_header, payload_data, video_packet_out); pthread_mutex_lock(&debugremutexvideo); if (debugrefilevideo != NULL) @@ -3276,6 +3282,7 @@ int rtpstream_rtpecho_stopaudio(rtpstream_callinfo_t* callinfo) if (debugrefileaudio) { fclose(debugrefileaudio); + debugrefileaudio = NULL; } } pthread_mutex_unlock(&debugremutexaudio); @@ -3448,6 +3455,8 @@ int rtpstream_rtpecho_stopvideo(rtpstream_callinfo_t* callinfo) if (debugrefilevideo) { fclose(debugrefilevideo); + debugrefilevideo = NULL; + } } pthread_mutex_unlock(&debugremutexvideo); @@ -3535,12 +3544,14 @@ int rtpstream_shutdown(std::unordered_map& threadIDs) rtpcheck_debug) { fclose(debugvfile); + debugvfile = NULL; } if (debugafile && rtpcheck_debug) { fclose(debugafile); + debugafile = NULL; } pthread_mutex_destroy(&debugamutex);