From 46b57feb2f588ec666f1fcc2d18720580d95e867 Mon Sep 17 00:00:00 2001 From: mannol Date: Sun, 6 Apr 2014 23:26:00 +0200 Subject: [PATCH 1/2] Codec settings --- src/audio_call.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/audio_call.c b/src/audio_call.c index 2d8043d..9fbe0b1 100644 --- a/src/audio_call.c +++ b/src/audio_call.c @@ -219,7 +219,11 @@ ToxAv* init_audio(ToxWindow* window, Tox* tox) } else { /* Streaming stuff from core */ - ASettins.av = toxav_new(tox, 0, 0); + + ToxAvCodecSettings cs = av_DefaultSettings; + cs.video_height = cs.video_width = 0; + + ASettins.av = toxav_new(tox, &cs); if ( !ASettins.av ) { ASettins.errors |= ErrorStartingCoreAudio; From 8ce1a3d3e96ed0c0b4f683a7a3cfae83264846f2 Mon Sep 17 00:00:00 2001 From: mannol Date: Sun, 6 Apr 2014 23:56:49 +0200 Subject: [PATCH 2/2] Codec settings and MORE! --- src/audio_call.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/audio_call.c b/src/audio_call.c index 5850151..3e9e3ab 100644 --- a/src/audio_call.c +++ b/src/audio_call.c @@ -24,6 +24,8 @@ #define MAX_DEVICES 32 #define _cbend pthread_exit(NULL) +#define AUDIO_FRAME_SIZE (av_DefaultSettings.audio_sample_rate * av_DefaultSettings.audio_frame_duration / 1000) + typedef struct _DeviceIx { ALCdevice* dhndl; /* Handle of device selected/opened */ @@ -86,7 +88,10 @@ int device_open (ToxWindow *self, _Devices type) if ( type == input ) { ASettins.device[type].dhndl = alcCaptureOpenDevice( - ASettins.device[type].devices[ASettins.device[type].index], AUDIO_SAMPLE_RATE, AL_FORMAT_MONO16, AUDIO_FRAME_SIZE * 4); + ASettins.device[type].devices[ASettins.device[type].index], + av_DefaultSettings.audio_sample_rate, + AL_FORMAT_MONO16, + AUDIO_FRAME_SIZE * 4); if (alcGetError(ASettins.device[type].dhndl) != AL_NO_ERROR) {