|
Line 0
Link Here
|
|
|
1 |
diff --git a/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc b/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc |
| 2 |
index 6da35e0..e337dd4 100644 |
| 3 |
--- a/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc |
| 4 |
+++ b/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc |
| 5 |
@@ -171,6 +171,16 @@ bool LinphoneVoiceChannel::SetPlayout(bool playout) { |
| 6 |
return true; |
| 7 |
} |
| 8 |
|
| 9 |
+#ifdef MEDIASTREAMER_LESS_2_11 |
| 10 |
+static inline RtpSession * audio_stream_get_rtp_session(const AudioStream *stream) { |
| 11 |
+#ifdef MEDIASTREAMER_LESS_2_9 |
| 12 |
+ return stream->session; |
| 13 |
+#else |
| 14 |
+ return stream->ms.session; |
| 15 |
+#endif |
| 16 |
+} |
| 17 |
+#endif |
| 18 |
+ |
| 19 |
bool LinphoneVoiceChannel::SetSendCodecs(const std::vector<AudioCodec>& codecs) { |
| 20 |
|
| 21 |
bool first = true; |
| 22 |
@@ -200,11 +210,7 @@ bool LinphoneVoiceChannel::SetSendCodecs(const std::vector<AudioCodec>& codecs) |
| 23 |
LOG(LS_INFO) << "Using " << i->name << "/" << i->clockrate; |
| 24 |
pt_ = i->id; |
| 25 |
audio_stream_ = audio_stream_start(&av_profile, -1, "localhost", port1, i->id, 250, 0); /* -1 means that function will choose some free port */ |
| 26 |
-#ifdef MEDIASTREAMER_OLD |
| 27 |
- port2 = rtp_session_get_local_port(audio_stream_->session); |
| 28 |
-#else |
| 29 |
- port2 = rtp_session_get_local_port(audio_stream_->ms.session); |
| 30 |
-#endif |
| 31 |
+ port2 = rtp_session_get_local_port(audio_stream_get_rtp_session(audio_stream_)); |
| 32 |
first = false; |
| 33 |
} |
| 34 |
} |
| 35 |
@@ -215,11 +221,7 @@ bool LinphoneVoiceChannel::SetSendCodecs(const std::vector<AudioCodec>& codecs) |
| 36 |
// working with a buggy client; let's try PCMU. |
| 37 |
LOG(LS_WARNING) << "Received empty list of codces; using PCMU/8000"; |
| 38 |
audio_stream_ = audio_stream_start(&av_profile, -1, "localhost", port1, 0, 250, 0); /* -1 means that function will choose some free port */ |
| 39 |
-#ifdef MEDIASTREAMER_OLD |
| 40 |
- port2 = rtp_session_get_local_port(audio_stream_->session); |
| 41 |
-#else |
| 42 |
- port2 = rtp_session_get_local_port(audio_stream_->ms.session); |
| 43 |
-#endif |
| 44 |
+ port2 = rtp_session_get_local_port(audio_stream_get_rtp_session(audio_stream_)); |
| 45 |
} |
| 46 |
|
| 47 |
return true; |