mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Fix no audio issue - because StunClient was corrupting localMediaDescription when no STUN discovery was actually made.
This commit is contained in:
parent
3f916b1972
commit
67b6f71939
3 changed files with 6 additions and 1 deletions
|
|
@ -930,6 +930,7 @@ lpc_cmd_firewall(LinphoneCore *lc, char *args)
|
|||
return 1;
|
||||
}
|
||||
linphone_core_set_firewall_policy(lc,LinphonePolicyUseNatAddress);
|
||||
setting = linphone_core_get_nat_address(lc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ using namespace std;
|
|||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
int StunClient::run (int audioPort, int videoPort, int textPort) {
|
||||
stunDiscoveryDone = false;
|
||||
if (linphone_core_ipv6_enabled(getCore()->getCCore())) {
|
||||
lWarning() << "STUN support is not implemented for ipv6";
|
||||
return -1;
|
||||
|
|
@ -139,10 +140,12 @@ int StunClient::run (int audioPort, int videoPort, int textPort) {
|
|||
close_socket(sockAudio);
|
||||
if (sockVideo != -1) close_socket(sockVideo);
|
||||
if (sockText != -1) close_socket(sockText);
|
||||
stunDiscoveryDone = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void StunClient::updateMediaDescription (SalMediaDescription *md) const {
|
||||
if (!stunDiscoveryDone) return;
|
||||
for (int i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; i++) {
|
||||
if (!sal_stream_description_active(&md->streams[i]))
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
class StunClient : public CoreAccessor {
|
||||
struct Candidate {
|
||||
std::string address;
|
||||
int port;
|
||||
int port = 0;
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
@ -67,6 +67,7 @@ private:
|
|||
Candidate audioCandidate;
|
||||
Candidate videoCandidate;
|
||||
Candidate textCandidate;
|
||||
bool stunDiscoveryDone = false;
|
||||
};
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue