1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-23 04:53:24 +01:00

Properly close audio devices on quit

This commit is contained in:
Jfreegman 2015-11-12 17:14:10 -05:00
parent ab99c1ac73
commit 65c07a57db
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
2 changed files with 7 additions and 8 deletions

View File

@ -570,7 +570,7 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[
{
const char *error_str = NULL;
if ( !self->is_call) {
if ( !self->is_call ) {
error_str = "Not in a call.";
goto on_error;
}
@ -587,11 +587,8 @@ void cmd_hangup(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[
#ifdef VIDEO
callback_video_end(self->num);
#endif /* VIDEO */
if ( CallControl.pending_call ) {
/* Manually send a cancel call control because call hasn't started */
toxav_call_control(CallControl.av, self->num, TOXAV_CALL_CONTROL_CANCEL, NULL);
@ -836,6 +833,8 @@ on_error:
void stop_current_call(ToxWindow* self)
{
TOXAV_ERR_CALL_CONTROL error;
toxav_call_control(CallControl.av, self->num, TOXAV_CALL_CONTROL_CANCEL, &error);
Call *this_call = &CallControl.calls[self->num];
if (this_call && self->is_call)
stop_transmission(this_call, self->num);
}

View File

@ -68,7 +68,7 @@ static void kill_infobox(ToxWindow *self);
#ifdef AUDIO
#define AC_NUM_CHAT_COMMANDS 30
#else
#define AC_NUM_CHAT_COMMANDS 23
#define AC_NUM_CHAT_COMMANDS 22
#endif /* AUDIO */
/* Array of chat command names used for tab completion. */
@ -95,7 +95,6 @@ static const char chat_cmd_list[AC_NUM_CHAT_COMMANDS][MAX_CMDNAME_SIZE] = {
{ "/savefile" },
{ "/sendfile" },
{ "/status" },
{ "/video" },
#ifdef AUDIO
@ -106,6 +105,7 @@ static const char chat_cmd_list[AC_NUM_CHAT_COMMANDS][MAX_CMDNAME_SIZE] = {
{ "/sdev" },
{ "/mute" },
{ "/sense" },
{ "/video" },
#endif /* AUDIO */
};