fix crash when video stream or audio stream not accepted

This commit is contained in:
Simon Morlat 2010-06-02 17:55:50 +02:00
parent 4fed6f5948
commit e7eb4edfbd
3 changed files with 7 additions and 4 deletions

View file

@ -2186,6 +2186,7 @@ static RtpProfile *make_profile(LinphoneCore *lc, const SalMediaDescription *md,
RtpProfile *prof=rtp_profile_new("Call profile");
bool_t first=TRUE;
int remote_bw=0;
*used_pt=-1;
for(elem=desc->payloads;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
@ -2237,7 +2238,7 @@ void linphone_core_start_media_streams(LinphoneCore *lc, LinphoneCall *call){
{
const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc,
SalProtoRtpAvp,SalAudio);
if (stream){
if (stream && stream->port!=0){
call->audio_profile=make_profile(lc,call->resultdesc,stream,&used_pt);
if (!lc->use_files){
MSSndCard *playcard=lc->sound_conf.play_sndcard;
@ -2286,7 +2287,7 @@ void linphone_core_start_media_streams(LinphoneCore *lc, LinphoneCall *call){
video_preview_stop(lc->previewstream);
lc->previewstream=NULL;
}
if (stream && (lc->video_conf.display || lc->video_conf.capture)) {
if (stream && stream->port!=0 && (lc->video_conf.display || lc->video_conf.capture)) {
const char *addr=stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr;
call->video_profile=make_profile(lc,call->resultdesc,stream,&used_pt);
video_stream_set_sent_video_size(lc->videostream,linphone_core_get_preferred_video_size(lc));
@ -2306,6 +2307,8 @@ void linphone_core_start_media_streams(LinphoneCore *lc, LinphoneCall *call){
stream->port+1,
used_pt, jitt_comp, lc->video_conf.device);
video_stream_set_rtcp_information(lc->videostream, cname,tool);
}else{
ms_warning("No valid video stream defined.");
}
}
#endif

@ -1 +1 @@
Subproject commit 5d984c3ea03d4bf40eeac257cfdd86efe2312392
Subproject commit a2a6119273226234ea7300742c34d46fa545fcd8

2
oRTP

@ -1 +1 @@
Subproject commit 4ad63e9a106aee8d9dfb675aa0532962f322609c
Subproject commit b9b53eedef812b44762976617840c2b98fca62b9