]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
few more tweaks on new conference video functionality w/ webrtc
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 18 Jul 2013 13:33:20 +0000 (08:33 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 18 Jul 2013 13:33:20 +0000 (08:33 -0500)
src/mod/applications/mod_conference/mod_conference.c

index 826e96157b1f27485b7deb7e953bf74afe7c0643..99b992befdcfd1a3be8dcd9ec51228caa7196dc9 100644 (file)
@@ -1583,6 +1583,10 @@ static void conference_set_video_floor_holder(conference_obj_t *conference, conf
        conference_member_t *old_member = NULL;
        int old_id = 0;
 
+       if (!member) {
+               switch_clear_flag(conference, CFLAG_VID_FLOOR_LOCK);
+       }
+
        if (switch_test_flag(conference, CFLAG_VIDEO_BRIDGE) || (!force && switch_test_flag(conference, CFLAG_VID_FLOOR_LOCK))) {
                return;
        }
@@ -1599,6 +1603,17 @@ static void conference_set_video_floor_holder(conference_obj_t *conference, conf
 
 
        switch_mutex_lock(conference->mutex);
+       if (!member) {
+               conference_member_t *imember;
+
+               for (imember = conference->members; imember; imember = imember->next) {
+                       if (imember != conference->video_floor_holder && switch_channel_test_flag(imember->channel, CF_VIDEO)) {
+                               member = imember;
+                               break;
+                       }
+               }
+       }
+
        if (member) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding video floor %s\n", 
                                                  switch_channel_get_name(member->channel));
@@ -5315,6 +5330,7 @@ static switch_status_t conf_api_sub_vid_floor(conference_member_t *member, switc
 
        if (!switch_channel_test_flag(member->channel, CF_VIDEO)) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Channel %s does not have video capability!\n", switch_channel_get_name(member->channel));
+               return SWITCH_STATUS_FALSE;
        }
 
        if (switch_test_flag(member->conference, CFLAG_VIDEO_BRIDGE)) {