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 <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22953}
This commit is contained in:
Tommi 2018-04-20 12:35:14 +02:00 committed by Commit Bot
parent ae8d8a1d22
commit 8f659a0bb4

View File

@ -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