From 422f9dd5df8e70ecca1e0aff83b0e2e114bc70aa Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Mon, 24 Feb 2020 12:01:11 -0800 Subject: [PATCH] Conditionally use OPUS_GET_IN_DTX if available OPUS_GET_IN_DTX was added 2019-04-15, but we still need to support building on systems with older versions of the Opus headers (eg. Debian Jessie, released 2015-04-25). This is needed to fix the "Build From Tarball" bot [1]. [1] https://ci.chromium.org/p/infra/builders/cron/Build%20From%20Tarball BUG=chromium:1047860,webrtc:11085 R=minyue@webrtc.org,henrick.lundin@webrtc.org Change-Id: I5418c3caf4d2c7da9b9ba43ce85879b1e0eec6e6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168560 Reviewed-by: Minyue Li Reviewed-by: Karl Wiberg Reviewed-by: Tommi Commit-Queue: Thomas Anderson Cr-Commit-Position: refs/heads/master@{#30612} --- modules/audio_coding/codecs/opus/opus_interface.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/audio_coding/codecs/opus/opus_interface.cc b/modules/audio_coding/codecs/opus/opus_interface.cc index 29aedf24b8..4bac365a89 100644 --- a/modules/audio_coding/codecs/opus/opus_interface.cc +++ b/modules/audio_coding/codecs/opus/opus_interface.cc @@ -376,12 +376,13 @@ int32_t WebRtcOpus_GetInDtx(OpusEncInst* inst) { if (!inst) { return -1; } +#ifdef OPUS_GET_IN_DTX int32_t in_dtx; if (ENCODER_CTL(inst, OPUS_GET_IN_DTX(&in_dtx)) == 0) { return in_dtx; - } else { - return -1; } +#endif + return -1; } int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst,