Commit f28153bb authored by Tristan Matthews's avatar Tristan Matthews

* #30347: audiortp: remove ScopedLock

parent 61df691a
......@@ -42,7 +42,6 @@
#include "sip/sipcall.h"
#include "sip/sipaccount.h"
#include "sip/sdes_negotiator.h"
#include "scoped_lock.h"
#include "logger.h"
namespace sfl {
......@@ -55,14 +54,11 @@ AudioRtpFactory::AudioRtpFactory(SIPCall *ca) : rtpSession_(NULL),
cachedRemoteMasterSalt_(MAX_MASTER_SALT_LENGTH),
remoteOfferIsSet_(false), ca_(ca),
keyExchangeProtocol_(NONE)
{
pthread_mutex_init(&audioRtpThreadMutex_, NULL);
}
{}
AudioRtpFactory::~AudioRtpFactory()
{
delete rtpSession_;
pthread_mutex_destroy(&audioRtpThreadMutex_);
}
void AudioRtpFactory::initConfig()
......@@ -105,7 +101,7 @@ void AudioRtpFactory::initConfig()
void AudioRtpFactory::initSession()
{
ScopedLock m(audioRtpThreadMutex_);
std::lock_guard<std::mutex> lock(audioRtpThreadMutex_);
if (srtpEnabled_) {
const std::string zidFilename(Manager::instance().voipPreferences.getZidFile());
......@@ -151,7 +147,7 @@ void AudioRtpFactory::start(const std::vector<AudioCodec*> &audioCodecs)
void AudioRtpFactory::stop()
{
ScopedLock mutex(audioRtpThreadMutex_);
std::lock_guard<std::mutex> lock(audioRtpThreadMutex_);
delete rtpSession_;
rtpSession_ = NULL;
......
......@@ -33,8 +33,7 @@
#include <ccrtp/CryptoContext.h>
#include <stdexcept>
#include <tr1/array>
#include <pthread.h>
#include <mutex>
#include "audio_rtp_session.h"
#include "audio_srtp_session.h"
#include "noncopyable.h"
......@@ -159,7 +158,7 @@ class AudioRtpFactory {
NON_COPYABLE(AudioRtpFactory);
enum KeyExchangeProtocol { NONE, SDES, ZRTP };
AudioRtpSession *rtpSession_;
pthread_mutex_t audioRtpThreadMutex_;
std::mutex audioRtpThreadMutex_;
// Field used when initializing audio rtp session
// May be set manually or from config using initAudioRtpConfig
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment