diff options
Diffstat (limited to 'media/audio/mac/audio_output_mac.cc')
-rw-r--r-- | media/audio/mac/audio_output_mac.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/media/audio/mac/audio_output_mac.cc b/media/audio/mac/audio_output_mac.cc index cd7c8eba..45de9a7 100644 --- a/media/audio/mac/audio_output_mac.cc +++ b/media/audio/mac/audio_output_mac.cc @@ -44,8 +44,7 @@ enum { #endif PCMQueueOutAudioOutputStream::PCMQueueOutAudioOutputStream( - AudioManagerMac* manager, int channels, int sampling_rate, - char bits_per_sample) + AudioManagerMac* manager, AudioParameters params) : format_(), audio_queue_(NULL), buffer_(), @@ -59,20 +58,20 @@ PCMQueueOutAudioOutputStream::PCMQueueOutAudioOutputStream( // A frame is one sample across all channels. In interleaved audio the per // frame fields identify the set of n |channels|. In uncompressed audio, a // packet is always one frame. - format_.mSampleRate = sampling_rate; + format_.mSampleRate = params.sample_rate; format_.mFormatID = kAudioFormatLinearPCM; format_.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger; - format_.mBitsPerChannel = bits_per_sample; - format_.mChannelsPerFrame = channels; + format_.mBitsPerChannel = params.bits_per_sample; + format_.mChannelsPerFrame = params.channels; format_.mFramesPerPacket = 1; - format_.mBytesPerPacket = (format_.mBitsPerChannel * channels) / 8; + format_.mBytesPerPacket = (format_.mBitsPerChannel * params.channels) / 8; format_.mBytesPerFrame = format_.mBytesPerPacket; // Silence buffer has a duration of 6ms to simulate the behavior of Windows. // This value is choosen by experiments and macs cannot keep up with // anything less than 6ms. - silence_bytes_ = format_.mBytesPerFrame * sampling_rate * 6 / 1000; + silence_bytes_ = format_.mBytesPerFrame * params.sample_rate * 6 / 1000; } PCMQueueOutAudioOutputStream::~PCMQueueOutAudioOutputStream() { |