From 8f659a0bb42bfe32873d3b089cdba58f570e18a4 Mon Sep 17 00:00:00 2001 From: Tommi Date: Fri, 20 Apr 2018 12:35:14 +0200 Subject: [PATCH] Dynamically allocate empty_data() instead of using in-binary buffer. In my local build of libjingle_peerconnection_so.so, this reduces the binary size by 8K. Change-Id: I727fc13c2baa3c70cda5f97c65eb17a08aaf8950 Bug: webrtc:9109 Reviewed-on: https://webrtc-review.googlesource.com/70460 Commit-Queue: Tommi Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#22953} --- api/audio/audio_frame.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/audio/audio_frame.cc b/api/audio/audio_frame.cc index 12ce426596..b477a17f22 100644 --- a/api/audio/audio_frame.cc +++ b/api/audio/audio_frame.cc @@ -120,9 +120,8 @@ bool AudioFrame::muted() const { return muted_; } // static const int16_t* AudioFrame::empty_data() { - static const int16_t kEmptyData[kMaxDataSizeSamples] = {0}; - static_assert(sizeof(kEmptyData) == kMaxDataSizeBytes, "kMaxDataSizeBytes"); - return kEmptyData; + static int16_t* null_data = new int16_t[kMaxDataSizeSamples](); + return &null_data[0]; } } // namespace webrtc