summaryrefslogtreecommitdiffstats
path: root/include/hardware_legacy/AudioHardwareInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hardware_legacy/AudioHardwareInterface.h')
-rw-r--r--include/hardware_legacy/AudioHardwareInterface.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/hardware_legacy/AudioHardwareInterface.h b/include/hardware_legacy/AudioHardwareInterface.h
index f5b38ea..d37da11 100644
--- a/include/hardware_legacy/AudioHardwareInterface.h
+++ b/include/hardware_legacy/AudioHardwareInterface.h
@@ -69,7 +69,8 @@ public:
/**
* return the frame size (number of bytes per sample).
*/
- uint32_t frameSize() const { return popcount(channels())*((format()==AUDIO_FORMAT_PCM_16_BIT)?sizeof(int16_t):sizeof(int8_t)); }
+ uint32_t frameSize() const { return audio_channel_count_from_out_mask(channels())*
+ ((format()==AUDIO_FORMAT_PCM_16_BIT)?sizeof(int16_t):sizeof(int8_t)); }
/**
* return the audio hardware driver latency in milli seconds.
@@ -145,7 +146,8 @@ public:
/**
* return the frame size (number of bytes per sample).
*/
- uint32_t frameSize() const { return AudioSystem::popCount(channels())*((format()==AudioSystem::PCM_16_BIT)?sizeof(int16_t):sizeof(int8_t)); }
+ uint32_t frameSize() const { return audio_channel_count_from_in_mask(channels())*
+ ((format()==AudioSystem::PCM_16_BIT)?sizeof(int16_t):sizeof(int8_t)); }
/** set the input gain for the audio driver. This method is for
* for future use */