grishka / libtgvoip

VoIP library for Telegram clients
The Unlicense
387 stars 156 forks source link

Audio callbacks are compiled in by default #68

Closed zevlg closed 5 years ago

zevlg commented 5 years ago

I've noticed that audio callbacks compiles in even if --enable-audio-callback is not specified. Might be a typo error for action-if-not-given in configure.ac. I use next patch:

index f5f5dc0..c21f162 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,7 @@ AS_CASE([$host_os],
 )
 AM_CONDITIONAL(TARGET_OS_OSX, test "x$os_osx" == xyes)

-AC_ARG_ENABLE([audio-callback], [AS_HELP_STRING([--enable-audio-callback], [enable callback-based audio I/O])], [], [enable_audio_callback=yes])
+AC_ARG_ENABLE([audio-callback], [AS_HELP_STRING([--enable-audio-callback], [enable callback-based audio I/O])], [], [enable_audio_callback=no])
 AM_CONDITIONAL(ENABLE_AUDIO_CALLBACK, test "x$enable_audio_callback" == xyes)

 AS_IF([test "x$os_osx" != xyes && test "x$enable_audio_callback" != xyes], [ # Linux

Enabling audio callbacks by default gives a problem, program that uses libtgvoip must also define TGVOIP_USE_CALLBACK_AUDIO_IO, because this macro is used to define VoIPController class members. I've got multiple random crashes before figured out that TGVOIP_USE_CALLBACK_AUDIO_IO was defined on libtgvoip compilation.

zevlg commented 5 years ago

Any chances to get this in master?

Or maybe rename help string to "--disable-audio-callback" (as for dsp feature), so user will get the idea that callbacks are compiled in by default?

grishka commented 5 years ago

Could you please make it a pull request?