Revision 3a3cc054 plugins/janus_videocall.c

View differences:

plugins/janus_videocall.c
519 519
	session->peer = NULL;
520 520
	session->username = NULL;
521 521
	session->destroyed = 0;
522
	g_atomic_int_set(&session->hangingup, 1);
522 523
	handle->plugin_handle = session;
523 524

  
524 525
	return;
......
607 608
	}
608 609
	if(session->destroyed)
609 610
		return;
611
	g_atomic_int_set(&session->hangingup, 0);
610 612
	/* We really don't care, as we only relay RTP/RTCP we get in the first place anyway */
611 613
}
612 614

  
......
761 763
		JANUS_LOG(LOG_ERR, "No session associated with this handle...\n");
762 764
		return;
763 765
	}
764
	if(session->destroyed || g_atomic_int_get(&session->hangingup))
766
	if(session->destroyed)
767
		return;
768
	if(g_atomic_int_add(&session->hangingup, 1))
765 769
		return;
766
	g_atomic_int_set(&session->hangingup, 1);
767 770
	if(session->peer) {
768 771
		/* Send event to our peer too */
769 772
		json_t *call = json_object();
......
785 788
	session->audio_active = TRUE;
786 789
	session->video_active = TRUE;
787 790
	session->bitrate = 0;
788
	/* Done */
789
	g_atomic_int_set(&session->hangingup, 0);
790 791
}
791 792

  
792 793
/* Thread to handle incoming messages */

Also available in: Unified diff