From a28a8f63afa0b9cedb09aa3eb85070123100c5fd Mon Sep 17 00:00:00 2001
From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Date: Fri, 31 Mar 2017 18:23:30 -0400
Subject: [PATCH] fix build on gcc below v5.2

gcc below 5.2 doesn't support usage of std::unique_ptr as method argument
with a default assignement to nullptr if the type is forward declared.

This patch is a quick fix, that remove the default assignement and
force the value where needed.

Change-Id: If619dceaed9cca9c9f00f3b9b3f92c768f2c1135
---
 src/media/audio/audio_rtp_session.h | 4 ++--
 src/media/rtp_session.h             | 6 ++++--
 src/media/video/video_rtp_session.h | 4 ++--
 src/sip/sipcall.cpp                 | 2 +-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/media/audio/audio_rtp_session.h b/src/media/audio/audio_rtp_session.h
index b60081bbf4..c00fb8d395 100644
--- a/src/media/audio/audio_rtp_session.h
+++ b/src/media/audio/audio_rtp_session.h
@@ -41,8 +41,8 @@ class AudioRtpSession : public RtpSession {
         AudioRtpSession(const std::string& id);
         virtual ~AudioRtpSession();
 
-        void start(std::unique_ptr<IceSocket> rtp_sock = nullptr,
-                   std::unique_ptr<IceSocket> rtcp_sock = nullptr) override;
+        void start(std::unique_ptr<IceSocket> rtp_sock,
+                   std::unique_ptr<IceSocket> rtcp_sock) override;
         void restartSender() override;
         void restartReceiver() override;
         void stop() override;
diff --git a/src/media/rtp_session.h b/src/media/rtp_session.h
index 6206181e0a..2a80154ccd 100644
--- a/src/media/rtp_session.h
+++ b/src/media/rtp_session.h
@@ -31,13 +31,15 @@
 
 namespace ring {
 
+class IceSocket;
+
 class RtpSession {
 public:
     RtpSession(const std::string &callID) : callID_(callID) {}
     virtual ~RtpSession() {};
 
-    virtual void start(std::unique_ptr<IceSocket> rtp_sock = nullptr,
-                       std::unique_ptr<IceSocket> rtcp_sock = nullptr) = 0;
+    virtual void start(std::unique_ptr<IceSocket> rtp_sock,
+                       std::unique_ptr<IceSocket> rtcp_sock) = 0;
     virtual void restartSender() = 0;
     virtual void restartReceiver() = 0;
     virtual void stop() = 0;
diff --git a/src/media/video/video_rtp_session.h b/src/media/video/video_rtp_session.h
index 724aee0efe..9c324e223d 100644
--- a/src/media/video/video_rtp_session.h
+++ b/src/media/video/video_rtp_session.h
@@ -59,8 +59,8 @@ public:
                     const DeviceParams& localVideoParams);
     ~VideoRtpSession();
 
-    void start(std::unique_ptr<IceSocket> rtp_sock = nullptr,
-               std::unique_ptr<IceSocket> rtcp_sock = nullptr) override;
+    void start(std::unique_ptr<IceSocket> rtp_sock,
+               std::unique_ptr<IceSocket> rtcp_sock) override;
     void restartSender() override;
     void restartReceiver() override;
     void stop() override;
diff --git a/src/sip/sipcall.cpp b/src/sip/sipcall.cpp
index 5d6187475a..29e48611f3 100644
--- a/src/sip/sipcall.cpp
+++ b/src/sip/sipcall.cpp
@@ -861,7 +861,7 @@ SIPCall::startAllMedia()
                            newIceSocket(ice_comp_id + 1));
                 ice_comp_id += 2;
             } else
-                rtp->start();
+                rtp->start(nullptr, nullptr);
         }
 
         switch (local.type) {
-- 
GitLab