From b3bcaaa242d9c80c29377a7aa623b956a644073a Mon Sep 17 00:00:00 2001 From: z3bra Date: Tue, 1 Nov 2016 22:57:24 +0100 Subject: Make use of audio default settings --- ratox.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ratox.c b/ratox.c index 4ad2a50..0102d1c 100644 --- a/ratox.c +++ b/ratox.c @@ -367,7 +367,7 @@ cbcallinvite(void *av, int32_t cnum, void *udata) } logmsg(": %s : Audio : Rx > Inviting (%luHz/%luch)\n", - f->name, avconfig.audio_sample_rate, avconfig.audio_channels); + f->name, AUDIOSAMPLERATE, AUDIOCHANNELS); ftruncate(f->fd[FCALL_STATE], 0); lseek(f->fd[FCALL_STATE], 0, SEEK_SET); @@ -535,7 +535,7 @@ sendfriendcalldata(struct friend *f) } pcm = AUDIOFRAME * AUDIOSAMPLERATE / 1000; - buf = malloc(pcm * AUDIOCHANNEL * 2); + buf = malloc(pcm * AUDIOCHANNELS * 2); if (!buf) eprintf("malloc:"); @@ -546,7 +546,7 @@ sendfriendcalldata(struct friend *f) nanosleep(&diff, NULL); } clock_gettime(CLOCK_MONOTONIC, &f->av.lastsent); - if (!toxav_audio_send_frame(av, f->av.num, buf, pcm, AUDIOCHANNEL, AUDIOCHANNEL, NULL)) + if (!toxav_audio_send_frame(av, f->av.num, buf, pcm, AUDIOCHANNELS, AUDIOCHANNELS, NULL)) weprintf("Failed to send audio frame\n"); } @@ -1206,8 +1206,8 @@ toxinit(void) eprintf("Core : ToxAV > Initialization failed\n"); toxavconfig = av_DefaultSettings; - framesize = (toxavconfig.audio_sample_rate * toxavconfig.audio_frame_duration * - toxavconfig.audio_channels) / 1000; + pcm = AUDIOFRAME * AUDIOSAMPLERATE / 1000; + framesize = (AUDIOSAMPLERATE * AUDIOFRAME * AUDIOCHANNELS) / 1000; tox_callback_connection_status(tox, cbconnstatus, NULL); tox_callback_friend_message(tox, cbfriendmessage, NULL); -- cgit v1.2.3