Revision 78955474 plugins/janus_streaming.c

View differences:

plugins/janus_streaming.c
318 318
	gboolean paused;
319 319
	janus_streaming_context context;
320 320
	gboolean stopping;
321
	guint64 destroyed;	/* Time at which this session was marked as destroyed */
321
	gboolean hangingup;
322
	gint64 destroyed;	/* Time at which this session was marked as destroyed */
322 323
} janus_streaming_session;
323 324
static GHashTable *sessions;
324 325
static GList *old_sessions;
......
1934 1935
		JANUS_LOG(LOG_ERR, "No session associated with this handle...\n");
1935 1936
		return;
1936 1937
	}
1937
	if(session->destroyed)
1938
	if(session->destroyed || session->hangingup)
1938 1939
		return;
1940
	session->hangingup = TRUE;
1939 1941
	/* FIXME Simulate a "stop" coming from the browser */
1940 1942
	janus_streaming_message *msg = calloc(1, sizeof(janus_streaming_message));
1941
	if(msg == NULL) {
1942
		JANUS_LOG(LOG_FATAL, "Memory error!\n");
1943
		return;
1944
	}
1945 1943
	msg->handle = handle;
1946 1944
	msg->message = json_loads("{\"request\":\"stop\"}", 0, NULL);
1947 1945
	msg->transaction = NULL;
1948 1946
	msg->sdp_type = NULL;
1949 1947
	msg->sdp = NULL;
1950 1948
	g_async_queue_push(messages, msg);
1949
	/* Done */
1950
	session->hangingup = FALSE;
1951 1951
}
1952 1952

  
1953 1953
/* Thread to handle incoming messages */

Also available in: Unified diff