From 3cd2bc7e3cf5e440db9ca292cbd1b653aeada14b Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 6 Jul 2018 15:45:35 +0000 Subject: [PATCH] Don't compile A/V code if AUDIO/VIDEO are not #defined. --- src/audio_call.c | 4 ++++ src/video_call.c | 4 ++++ src/video_device.c | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/audio_call.c b/src/audio_call.c index 2eeebcb..b2b7929 100644 --- a/src/audio_call.c +++ b/src/audio_call.c @@ -31,6 +31,8 @@ #include "friendlist.h" #include "chat.h" +#ifdef AUDIO + #ifdef VIDEO #include "video_call.h" #endif /* VIDEO */ @@ -942,3 +944,5 @@ void del_friend_AV(uint32_t index) realloc_calls(index); CallControl.max_calls = index; } + +#endif diff --git a/src/video_call.c b/src/video_call.c index f46e037..6b30df7 100644 --- a/src/video_call.c +++ b/src/video_call.c @@ -37,6 +37,8 @@ #include #include +#ifdef VIDEO + #define default_video_bit_rate 5000 void receive_video_frame_cb( ToxAV *av, uint32_t friend_number, @@ -422,3 +424,5 @@ void stop_video_stream(ToxWindow *self) if (this_call && this_call->vin_idx != -1) stop_video_transmission(this_call, self->num); } + +#endif diff --git a/src/video_device.c b/src/video_device.c index 89fa33d..e899735 100644 --- a/src/video_device.c +++ b/src/video_device.c @@ -55,6 +55,8 @@ #include #include +#ifdef VIDEO + #define inline__ inline __attribute__((always_inline)) extern struct user_settings *user_settings; @@ -96,9 +98,7 @@ static int size[2]; /* Size of above containers */ VideoDevice *video_devices_running[2][MAX_DEVICES] = {{NULL}}; /* Running devices */ uint32_t primary_video_device[2]; /* Primary device */ -#ifdef VIDEO static ToxAV *av = NULL; -#endif /* VIDEO */ /* q_mutex */ #define lock pthread_mutex_lock(&video_mutex); @@ -827,3 +827,5 @@ VideoDeviceError video_selection_valid(VideoDeviceType type, int32_t selection) { return (size[type] <= selection || selection < 0) ? vde_InvalidSelection : vde_None; } + +#endif /* VIDEO */