diff options
author | z3bra <contactatz3bradotorg> | 2016-11-01 22:57:24 +0100 |
---|---|---|
committer | z3bra <contactatz3bradotorg> | 2016-11-08 16:47:51 +0100 |
commit | b3bcaaa242d9c80c29377a7aa623b956a644073a (patch) | |
tree | ab35f5cc5c73456cf7955b0de6fa658d04669de1 /ratox.c | |
parent | e37560d5c2cf3d0e12192475321410331d618e3f (diff) |
Make use of audio default settings
Diffstat (limited to 'ratox.c')
-rw-r--r-- | ratox.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); |