Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8528ed43 authored by Andy Hung's avatar Andy Hung
Browse files

Use channelCountFromOutChannelMask in AudioTrack

Change-Id: I3bac3f9bae0816f78db1dc410963274eb0439e10
parent 2b37034c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -512,7 +512,7 @@ public class AudioTrack
                throw new IllegalArgumentException("Unsupported channel configuration.");
            }
            mChannels = channelConfig;
            mChannelCount = Integer.bitCount(channelConfig);
            mChannelCount = AudioFormat.channelCountFromOutChannelMask(channelConfig);
        }

        //--------------
@@ -546,7 +546,7 @@ public class AudioTrack
            loge("Channel configuration features unsupported channels");
            return false;
        }
        final int channelCount = Integer.bitCount(channelConfig);
        final int channelCount = AudioFormat.channelCountFromOutChannelMask(channelConfig);
        if (channelCount > CHANNEL_COUNT_MAX) {
            loge("Channel configuration contains too many channels " +
                    channelCount + ">" + CHANNEL_COUNT_MAX);
@@ -828,7 +828,7 @@ public class AudioTrack
                loge("getMinBufferSize(): Invalid channel configuration.");
                return ERROR_BAD_VALUE;
            } else {
                channelCount = Integer.bitCount(channelConfig);
                channelCount = AudioFormat.channelCountFromOutChannelMask(channelConfig);
            }
        }