From 8b770d0f5cf55275965a8d66344169c8845a3790 Mon Sep 17 00:00:00 2001
From: asavard <asavard@asavard-KT378AA-A2L-a6552f.(none)>
Date: Tue, 26 Oct 2010 18:56:04 -0400
Subject: [PATCH] [#4367] Fix AudioRtpclass using TRTPSessionBase

---
 .../src/audio/audiortp/AudioRtpSession.cpp        | 15 ++++++++++-----
 .../src/audio/audiortp/AudioRtpSession.h          |  3 ++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/sflphone-common/src/audio/audiortp/AudioRtpSession.cpp b/sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
index d0199adf9b..f46471e8a1 100644
--- a/sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
+++ b/sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
@@ -42,7 +42,12 @@ namespace sfl
 {
 
 AudioRtpSession::AudioRtpSession (ManagerImpl * manager, SIPCall * sipcall) :
-		ost::SymmetricRTPSession (ost::InetHostAddress (sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort()),
+		// ost::SymmetricRTPSession (ost::InetHostAddress (sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort()),
+		TRTPSessionBase<ost::DualRTPUDPIPv4Channel,ost::DualRTPUDPIPv4Channel,ost::AVPQueue>(ost::InetHostAddress (sipcall->getLocalIp().c_str()),
+																												   sipcall->getLocalAudioPort(),
+																												   0,
+																												   ost::MembershipBookkeeping::defaultMembersHashSize,
+																												   ost::defaultApplication()),
 		AudioRtpRecordHandler(manager, sipcall)
 																			, _time (new ost::Time())
         																	, _mainloopSemaphore (0)
@@ -53,7 +58,7 @@ AudioRtpSession::AudioRtpSession (ManagerImpl * manager, SIPCall * sipcall) :
         																	, _countNotificationTime (0)
         																	, _ca (sipcall)
 {
-	this->setCancel (cancelDefault);
+	static_cast<ost::Thread *>(this)->setCancel (cancelDefault);
 
     assert (_ca);
 
@@ -66,7 +71,7 @@ AudioRtpSession::~AudioRtpSession()
     _debug ("AudioRtpSession: Delete AudioRtpSession instance");
 
     try {
-    	this->terminate();
+    	static_cast<ost::Thread *>(this)->terminate();
     } catch (...) {
         _debugException ("AudioRtpSession: Thread destructor didn't terminate correctly");
         throw;
@@ -266,7 +271,7 @@ int AudioRtpSession::startRtpThread (AudioCodec* audiocodec)
     setSessionTimeouts();
     setSessionMedia (audiocodec);
     initBuffers();
-    int ret = this->start (_mainloopSemaphore);
+    int ret = static_cast<ost::Thread *>(this)->start (_mainloopSemaphore);
     this->startRunning();
     return ret;
 }
@@ -299,7 +304,7 @@ void AudioRtpSession::run ()
 
     _debug ("AudioRtpSession: Entering mainloop for call %s",_ca->getCallId().c_str());
 
-    while (!testCancel()) {
+    while (!static_cast<ost::Thread *>(this)->testCancel()) {
 
         // Reset timestamp to make sure the timing information are up to date
         if (_timestampCount > RTP_TIMESTAMP_RESET_FREQ) {
diff --git a/sflphone-common/src/audio/audiortp/AudioRtpSession.h b/sflphone-common/src/audio/audiortp/AudioRtpSession.h
index 272d2b68ca..0f3084b153 100644
--- a/sflphone-common/src/audio/audiortp/AudioRtpSession.h
+++ b/sflphone-common/src/audio/audiortp/AudioRtpSession.h
@@ -57,7 +57,8 @@ namespace sfl
 {
 
 // class AudioRtpSession : public ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::SymmetricRTPSession
-class AudioRtpSession : public ost::TimerPort, public ost::SymmetricRTPSession, public AudioRtpRecordHandler
+// class AudioRtpSession : public ost::Thread, public ost::TimerPort, public ost::SymmetricRTPSession, public AudioRtpRecordHandler
+class AudioRtpSession : public ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::TRTPSessionBase<ost::DualRTPUDPIPv4Channel,ost::DualRTPUDPIPv4Channel,ost::AVPQueue>
 {
     public:
         /**
-- 
GitLab