From 5b363e72aa714061d827d7dcf7f666c5998fa514 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 13 Nov 2018 11:06:38 +0100 Subject: [PATCH] Allow building without libsoxr support. --- libfreerdp/codec/dsp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libfreerdp/codec/dsp.c b/libfreerdp/codec/dsp.c index 08279a8cc..7d896ef00 100644 --- a/libfreerdp/codec/dsp.c +++ b/libfreerdp/codec/dsp.c @@ -131,9 +131,6 @@ static BOOL freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context, size_t srcChannels, dstChannels; AUDIO_FORMAT format; - if (!context || !src || !srcFormat || !data || !length) - return FALSE; - if (srcFormat->wFormatTag != WAVE_FORMAT_PCM) { WLog_ERR(TAG, "%s requires %s for sample input, got %s", __FUNCTION__, @@ -153,6 +150,7 @@ static BOOL freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context, if (audio_format_compatible(&format, &context->format)) return TRUE; +#if defined(WITH_SOXR) sbytes = srcChannels * srcBytesPerFrame; sframes = size / sbytes; rbytes = dstBytesPerFrame * dstChannels; @@ -171,6 +169,10 @@ static BOOL freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context, *data = Stream_Buffer(context->resample); *length = Stream_Length(context->resample); return (error == 0) ? TRUE : FALSE; +#else + WLog_ERR(TAG, "Missing resample support, recompile -DWITH_SOXR=ON or -DWITH_DSP_FFMPEG=ON"); + return FALSE; +#endif } /**