1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-01 17:27:45 +02:00

AV api changes

This commit is contained in:
Jfreegman 2014-11-30 09:27:45 -05:00
parent 867f041c23
commit e995a1cb69
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
3 changed files with 7 additions and 9 deletions

View File

@ -145,7 +145,7 @@ ToxAv *init_audio(ToxWindow *self, Tox *tox)
toxav_register_callstate_callback(ASettins.av, callback_peer_timeout, av_OnPeerTimeout, self);
//toxav_register_callstate_callback(ASettins.av, callback_media_change, av_OnMediaChange, self);
toxav_register_audio_callback(write_device_callback, NULL);
toxav_register_audio_callback(ASettins.av, write_device_callback, NULL);
return ASettins.av;
}
@ -378,7 +378,7 @@ void cmd_call(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA
ToxAvError error = toxav_call(ASettins.av, &self->call_idx, self->num, &ASettins.cs, 30);
if ( error != av_ErrorNone ) {
if ( error == av_ErrorAlreadyInCall ) error_str = "Already in a call!";
if ( error == av_ErrorAlreadyInCallWithPeer ) error_str = "Already in a call!";
else error_str = "Internal error!";
goto on_error;

View File

@ -431,12 +431,10 @@ void* thread_poll (void* arg) // TODO: maybe use thread for every input source
int16_t frame[16000];
alcCaptureSamples(device->dhndl, frame, f_size);
if ( device->muted
#ifdef AUDIO
|| (device->enable_VAD && !toxav_has_activity(av, device->call_idx, frame, f_size, device->VAD_treshold))
#endif /* AUDIO */
)
{ unlock; continue; } /* Skip if no voice activity */
if (device->muted) {
unlock;
continue;
}
if ( device->cb ) device->cb(frame, f_size, device->cb_data);
}

View File

@ -1030,7 +1030,7 @@ static void friendlist_onAv(ToxWindow *self, ToxAv *av, int call_index)
{
int id = toxav_get_peer_id(av, call_index, 0);
if ( id != av_ErrorInternal && id >= Friends.max_idx)
if ( id != av_ErrorUnknown && id >= Friends.max_idx)
return;
Tox *m = toxav_get_tox(av);