]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10019: [mod_conference] Crash when playing mp4 in personal-canvas mode #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 8 Feb 2017 19:53:10 +0000 (13:53 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 8 Feb 2017 19:54:44 +0000 (13:54 -0600)
src/mod/applications/mod_conference/conference_video.c

index b566e3f0715c0a940dc89fc37dace239d5ab9604..2cf5f58e54c5af9755353b308a0cee7c68cdeff5 100644 (file)
@@ -2408,6 +2408,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 
                video_count = 0;
 
+               switch_mutex_lock(conference->mutex);
                if (conference->async_fnode && switch_core_file_has_video(&conference->async_fnode->fh, SWITCH_TRUE)) {
                        check_async_file = 1;
                        file_count++;
@@ -2421,7 +2422,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                        video_count++;
                        files_playing = 1;
                }
-
+               switch_mutex_unlock(conference->mutex);
 
                switch_mutex_lock(conference->member_mutex);
                for (imember = conference->members; imember; imember = imember->next) {
@@ -2853,8 +2854,10 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                                conference->new_personal_vlayout = NULL;
                                layout_applied = 0;
                        }
+
+                       switch_mutex_lock(conference->mutex);
                        
-                       if (check_async_file) {
+                       if (check_async_file && conference->async_fnode) {
                                switch_status_t st = switch_core_file_read_video(&conference->async_fnode->fh, &file_frame, SVR_FLUSH);
                                
                                if (st == SWITCH_STATUS_SUCCESS) {
@@ -2867,7 +2870,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                                }
                        }
 
-                       if (check_file) {
+                       if (check_file && conference->fnode) {
                                switch_status_t st = switch_core_file_read_video(&conference->fnode->fh, &file_frame, SVR_FLUSH);
 
                                if (st == SWITCH_STATUS_SUCCESS) {
@@ -2879,6 +2882,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                                        j++;
                                }
                        }
+                       switch_mutex_unlock(conference->mutex);
 
                        for (imember = conference->members; imember; imember = imember->next) {
                                int i = 0;