Commit 84a59d62 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed nb_stream variable in resultdesc and fixed test to detect change between two media descs

parent cae3cd4f
...@@ -564,6 +564,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities ...@@ -564,6 +564,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities
SalMediaDescription *result, bool_t one_matching_codec){ SalMediaDescription *result, bool_t one_matching_codec){
int i; int i;
const SalStreamDescription *ls=NULL,*rs; const SalStreamDescription *ls=NULL,*rs;
result->nb_streams = 0;
for(i=0;i<SAL_MEDIA_DESCRIPTION_MAX_STREAMS;++i){ for(i=0;i<SAL_MEDIA_DESCRIPTION_MAX_STREAMS;++i){
rs=&remote_offer->streams[i]; rs=&remote_offer->streams[i];
...@@ -588,6 +589,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities ...@@ -588,6 +589,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities
result->streams[i].rtcp_xr.enabled = TRUE; result->streams[i].rtcp_xr.enabled = TRUE;
} }
} }
result->nb_streams++;
}else { }else {
ms_message("Declining mline %i, no corresponding stream in local capabilities description.",i); ms_message("Declining mline %i, no corresponding stream in local capabilities description.",i);
/* create an inactive stream for the answer, as there where no matching stream in local capabilities */ /* create an inactive stream for the answer, as there where no matching stream in local capabilities */
...@@ -603,7 +605,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities ...@@ -603,7 +605,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities
} }
} }
} }
result->nb_streams=i;
strcpy(result->username, local_capabilities->username); strcpy(result->username, local_capabilities->username);
strcpy(result->addr,local_capabilities->addr); strcpy(result->addr,local_capabilities->addr);
result->bandwidth=local_capabilities->bandwidth; result->bandwidth=local_capabilities->bandwidth;
......
...@@ -342,7 +342,7 @@ int sal_media_description_equals(const SalMediaDescription *md1, const SalMediaD ...@@ -342,7 +342,7 @@ int sal_media_description_equals(const SalMediaDescription *md1, const SalMediaD
if (md1->nb_streams != md2->nb_streams) result |= SAL_MEDIA_DESCRIPTION_STREAMS_CHANGED; if (md1->nb_streams != md2->nb_streams) result |= SAL_MEDIA_DESCRIPTION_STREAMS_CHANGED;
if (md1->bandwidth != md2->bandwidth) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED; if (md1->bandwidth != md2->bandwidth) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
for(i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; ++i){ for(i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; ++i){
if (!sal_stream_description_active(&md1->streams[i]) || !sal_stream_description_active(&md2->streams[i])) continue; if (!sal_stream_description_active(&md1->streams[i]) && !sal_stream_description_active(&md2->streams[i])) continue;
result |= sal_stream_description_equals(&md1->streams[i], &md2->streams[i]); result |= sal_stream_description_equals(&md1->streams[i], &md2->streams[i]);
} }
return result; return result;
......
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