From 36636a2d6cb3eb7fc39618735bf9ce983fd064b1 Mon Sep 17 00:00:00 2001 From: henrika Date: Fri, 20 Oct 2017 12:14:57 +0200 Subject: [PATCH] Removes StaticAccessedFromInstance warning in Android audio track. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the warning below: WebRtcAudioTrack.java:364: warning: [StaticAccessedFromInstance] Static method getMaxVolume should not be accessed from an object instance; instead use AudioTrack.getMaxVolume + "max gain: " + audioTrack.getMaxVolume()); Bug: NONE Change-Id: I6247584b65ac972a6a3739fba718387873964f9f Reviewed-on: https://webrtc-review.googlesource.com/14180 Reviewed-by: Sami Kalliomäki Commit-Queue: Henrik Andreassson Cr-Commit-Position: refs/heads/master@{#20371} --- .../java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java index 26d83102bd..ae0217d4a4 100644 --- a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java +++ b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java @@ -221,7 +221,7 @@ public class WebRtcAudioTrack { private boolean initPlayout(int sampleRate, int channels) { Logging.d(TAG, "initPlayout(sampleRate=" + sampleRate + ", channels=" + channels + ")"); final int bytesPerFrame = channels * (BITS_PER_SAMPLE / 8); - byteBuffer = byteBuffer.allocateDirect(bytesPerFrame * (sampleRate / BUFFERS_PER_SECOND)); + byteBuffer = ByteBuffer.allocateDirect(bytesPerFrame * (sampleRate / BUFFERS_PER_SECOND)); Logging.d(TAG, "byteBuffer.capacity: " + byteBuffer.capacity()); emptyBytes = new byte[byteBuffer.capacity()]; // Rather than passing the ByteBuffer with every callback (requiring @@ -361,7 +361,7 @@ public class WebRtcAudioTrack { + "channels: " + audioTrack.getChannelCount() + ", " + "sample rate: " + audioTrack.getSampleRate() + ", " // Gain (>=1.0) expressed as linear multiplier on sample values. - + "max gain: " + audioTrack.getMaxVolume()); + + "max gain: " + AudioTrack.getMaxVolume()); } // Creates and AudioTrack instance using AudioAttributes and AudioFormat as input.