]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore.c
Merge branch 'master' of git.linphone.org:linphone-private
[linphone] / coreapi / linphonecore.c
index 518d887b203bf7247430d4ea0baef235f1912e01..54de627f12cc34c176553bae35c8de57ab775532 100644 (file)
@@ -2204,6 +2204,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;
@@ -2255,7 +2256,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;
@@ -2304,7 +2305,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));
@@ -2324,6 +2325,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