-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrtp_payload_checks.patch
55 lines (52 loc) · 2.87 KB
/
rtp_payload_checks.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff --git a/liblinphone/src/sal/offeranswer.cpp b/liblinphone/src/sal/offeranswer.cpp
index 57759524f..71b38c895 100644
--- a/liblinphone/src/sal/offeranswer.cpp
+++ b/liblinphone/src/sal/offeranswer.cpp
@@ -173,15 +173,24 @@ bool OfferAnswerEngine::onlyTelephoneEvent(const std::list<OrtpPayloadType*> & l
return true;
}
-PayloadType * OfferAnswerEngine::genericMatch(const std::list<OrtpPayloadType*> & local_payloads, const PayloadType *refpt, BCTBX_UNUSED(const std::list<OrtpPayloadType*> &remote_payloads)){
+PayloadType * OfferAnswerEngine::genericMatch(const std::list<OrtpPayloadType*> & local_payloads, const PayloadType *refpt, const std::list<OrtpPayloadType*> &remote_payloads){
for (const auto & pt : local_payloads) {
-
+ // ms_message("local_payload (%s/%i/%i) vs ref (%s/%i/%i)", pt->mime_type, pt->clock_rate, pt->channels, refpt->mime_type, refpt->clock_rate, refpt->channels);
if ( pt->mime_type && refpt->mime_type
&& strcasecmp(pt->mime_type, refpt->mime_type)==0
&& pt->clock_rate==refpt->clock_rate
&& pt->channels==refpt->channels)
return payload_type_clone(pt);
}
+ // TN hack - check remote payloads as well
+ for (const auto & pt : remote_payloads) {
+ // ms_message("remote_payload (%s/%i/%i) vs ref (%s/%i/%i)", pt->mime_type, pt->clock_rate, pt->channels, refpt->mime_type, refpt->clock_rate, refpt->channels);
+ if ( pt->mime_type && refpt->mime_type
+ && strcasecmp(pt->mime_type, refpt->mime_type)==0
+ && pt->clock_rate==refpt->clock_rate
+ && pt->channels==refpt->channels)
+ return payload_type_clone(pt);
+ }
return NULL;
}
@@ -190,20 +199,9 @@ PayloadType * OfferAnswerEngine::genericMatch(const std::list<OrtpPayloadType*>
*/
PayloadType * OfferAnswerEngine::findPayloadTypeBestMatch(MSFactory *factory, const std::list<OrtpPayloadType*> & local_payloads, const PayloadType *refpt,
const std::list<OrtpPayloadType*> & remote_payloads, bool reading_response){
- PayloadType *ret = NULL;
- MSOfferAnswerContext *ctx = NULL;
-
- // When a stream is inactive, refpt->mime_type might be null
- if (refpt->mime_type && (ctx = ms_factory_create_offer_answer_context(factory, refpt->mime_type))) {
- ms_message("Doing offer/answer processing with specific provider for codec [%s]", refpt->mime_type);
- auto local_payloads_list = Utils::listToBctbxList(local_payloads);
- auto remote_payloads_list = Utils::listToBctbxList(remote_payloads);
- ret = ms_offer_answer_context_match_payload(ctx, local_payloads_list, refpt, remote_payloads_list, reading_response);
- bctbx_list_free(local_payloads_list);
- bctbx_list_free(remote_payloads_list);
- ms_offer_answer_context_destroy(ctx);
- return ret;
- }
+ // TN hack - just use genericMatch
+ (void)factory;
+ (void)reading_response;
return OfferAnswerEngine::genericMatch(local_payloads, refpt, remote_payloads);
}