Commit b1e084c4 authored by Simon Morlat's avatar Simon Morlat
Browse files

Fix non working video upon receiving a video call, when the stun server couldn't be resolved.

The problem was that the gathering was started accidentally when accepting the call, but it is too late for this.
The video stream was then in the preparing state while requested to start, so it refused to start.
The incoming RTP packets were then processed by the ICE gathering graph, which did nothing with except logging error messages "unknwon payload type XXX".
parent 3a62d27f
......@@ -3729,7 +3729,7 @@ void MediaSessionPrivate::accept (const MediaSessionParams *msp, bool wasRinging
if (msp) {
setParams(new MediaSessionParams(*msp));
iceAgent->prepare(localDesc, true);
iceAgent->prepare(localDesc, true, false /*we don't allow gathering now, it must have been done before*/);
......@@ -127,7 +127,7 @@ bool IceAgent::isControlling () const {
return ice_session_role(iceSession) == IR_Controlling;
bool IceAgent::prepare (const SalMediaDescription *localDesc, bool incomingOffer) {
bool IceAgent::prepare (const SalMediaDescription *localDesc, bool incomingOffer, bool allowGathering) {
if (!iceSession)
return false;
......@@ -147,10 +147,11 @@ bool IceAgent::prepare (const SalMediaDescription *localDesc, bool incomingOffer
prepareIceForStream(mediaSession.getPrivate()->getMediaStream(LinphoneStreamTypeText), true);
// Start ICE gathering.
if (incomingOffer)
if (incomingOffer){
// This may delete the ice session.
updateFromRemoteMediaDescription(localDesc, remoteDesc, true);
if (iceSession && !ice_session_candidates_gathered(iceSession)) {
if (iceSession && allowGathering && !ice_session_candidates_gathered(iceSession)) {
int err = gatherIceCandidates();
if (err == 0) {
......@@ -57,7 +57,7 @@ public:
bool isControlling () const;
bool prepare (const SalMediaDescription *localDesc, bool incomingOffer);
bool prepare (const SalMediaDescription *localDesc, bool incomingOffer, bool allowGathering = true);
void prepareIceForStream (MediaStream *ms, bool createChecklist);
void resetSession (IceRole role);
void restartSession (IceRole role);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment