Merge branch 'master' of https://github.com/mannol1/ProjectTox-Core into mouseym-patch-3

This commit is contained in:
irungentoo 2014-03-14 21:12:05 -04:00
commit 99d8300e1b
4 changed files with 22 additions and 20 deletions

View File

@ -117,7 +117,7 @@ typedef struct _MSIMessage {
static struct _Callbacks {
MSICallback function;
void* data;
} callbacks[10] = {0};
} callbacks[11] = {0};
inline__ void invoke_callback(MSICallbackID id)
{
@ -653,7 +653,7 @@ void handle_remote_connection_change(Messenger *messenger, int friend_num, uint8
for ( ; i < session->call->peer_count; i ++ )
if ( session->call->peers[i] == friend_num ) {
msi_stopcall(session); /* Stop the call for now */
invoke_callback(MSI_OnPeerTimeout);
return;
}
}
@ -747,10 +747,9 @@ void *handle_timeout ( void *arg )
}
return NULL;
pthread_exit(NULL);
}
/**
* @brief Add peer to peer list.
*
@ -1244,13 +1243,12 @@ int msi_terminate_session ( MSISession *session )
assert ( session );
int _status = 0;
terminate_call ( session );
/* If have call, cancel it */
if ( session->call ) msi_cancel(session, 0, "MSI session terminated!");
m_callback_msi_packet((struct Messenger *) session->messenger_handle, NULL, NULL);
/* TODO: Clean it up more? */
free ( session );
return _status;
}

View File

@ -131,7 +131,8 @@ typedef enum {
/* Protocol */
MSI_OnError,
MSI_OnRequestTimeout
MSI_OnRequestTimeout,
MSI_OnPeerTimeout
} MSICallbackID;

View File

@ -1147,18 +1147,21 @@ failed_init_ffmpeg: ;
int av_terminate_session(av_session_t *_phone)
{
toxav_hangup(_phone->av);
free(_phone->_friends);
pthread_mutex_destroy ( &_phone->_mutex );
_phone->running_decaud = 0;
usleep(100000); /* Wait for tox_poll to end */
toxav_kill(_phone->av);
printf("\r[i] KILLED AV ARGH!\n");
usleep(1000000); /* Wait for cancel request to be sent */
Tox *_p = _phone->_messenger;
_phone->_messenger = NULL;
usleep(100000); /* Wait for tox_poll to end */
tox_kill(_p);
toxav_kill(_phone->av);
free(_phone->_friends);
pthread_mutex_destroy ( &_phone->_mutex );
free(_phone);
printf("\r[i] Quit!\n");

View File

@ -70,8 +70,8 @@ typedef enum {
/* Protocol */
av_OnError,
av_OnRequestTimeout
av_OnRequestTimeout,
av_OnPeerTimeout
} ToxAvCallbackID;