Commit d67c1e4f authored by Simon Morlat's avatar Simon Morlat Committed by François Grisez

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".

(cherry picked from commit b1e084c4)
parent 5ccf17df
......@@ -3731,7 +3731,7 @@ void MediaSessionPrivate::accept (const MediaSessionParams *msp, bool wasRinging
L_Q();
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*/);
makeLocalMediaDescription();
op->setLocalMediaDescription(localDesc);
}
......
......@@ -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)) {
mediaSession.getPrivate()->prepareStreamsForIceGathering(hasVideo);
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