Commit 0c2c5f65 authored by Simon Morlat's avatar Simon Morlat
Browse files

update ms2 for conferencing cleanups

parent 22cdda2a
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "mediastreamer2/msvolume.h" #include "mediastreamer2/msvolume.h"
static int convert_conference_to_call(LinphoneCore *lc);
static void conference_check_init(LinphoneConference *ctx, int samplerate){ static void conference_check_init(LinphoneConference *ctx, int samplerate){
if (ctx->conf==NULL){ if (ctx->conf==NULL){
MSAudioConferenceParams params; MSAudioConferenceParams params;
...@@ -48,24 +50,22 @@ static void remove_local_endpoint(LinphoneConference *ctx){ ...@@ -48,24 +50,22 @@ static void remove_local_endpoint(LinphoneConference *ctx){
} }
static int remote_participants_count(LinphoneConference *ctx) { static int remote_participants_count(LinphoneConference *ctx) {
if (!ctx->conf || ctx->conf->nmembers==0) return 0; if (!ctx->conf || ms_audio_conference_get_size(ctx->conf)==0) return 0;
if (!ctx->local_participant) return ctx->conf->nmembers; if (!ctx->local_participant) return ms_audio_conference_get_size(ctx->conf);
return ctx->conf->nmembers -1; return ms_audio_conference_get_size(ctx->conf) -1;
} }
static int convert_conference_to_call(LinphoneCore *lc);
void linphone_core_conference_check_uninit(LinphoneCore *lc){ void linphone_core_conference_check_uninit(LinphoneCore *lc){
LinphoneConference *ctx=&lc->conf_ctx; LinphoneConference *ctx=&lc->conf_ctx;
if (ctx->conf){ if (ctx->conf){
ms_message("conference_check_uninit(): nmembers=%i",ctx->conf->nmembers); ms_message("conference_check_uninit(): nmembers=%i",ms_audio_conference_get_size(ctx->conf));
if (remote_participants_count(ctx)==1){ if (remote_participants_count(ctx)==1){
convert_conference_to_call(lc); convert_conference_to_call(lc);
} }
if (ctx->conf->nmembers==1) if (ms_audio_conference_get_size(ctx->conf)==1 && ctx->local_participant!=NULL){
if (ctx->conf->nmembers==1 && ctx->local_participant!=NULL){
remove_local_endpoint(ctx); remove_local_endpoint(ctx);
} }
if (ctx->conf->nmembers==0){ if (ms_audio_conference_get_size(ctx->conf)==0){
ms_audio_conference_destroy(ctx->conf); ms_audio_conference_destroy(ctx->conf);
ctx->conf=NULL; ctx->conf=NULL;
} }
...@@ -298,5 +298,5 @@ int linphone_core_terminate_conference(LinphoneCore *lc) { ...@@ -298,5 +298,5 @@ int linphone_core_terminate_conference(LinphoneCore *lc) {
} }
int linphone_core_get_conference_size(LinphoneCore *lc) { int linphone_core_get_conference_size(LinphoneCore *lc) {
return ms_audio_conference_size(lc->conf_ctx.conf); return ms_audio_conference_get_size(lc->conf_ctx.conf);
} }
mediastreamer2 @ c1f6d3e6
Subproject commit 698cadf4ed473f4d1291238852492222209916da Subproject commit c1f6d3e6d4f36928fffd2e7380759544bcd23d84
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