diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index 8b16134b4..fe6a71d93 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -674,7 +674,7 @@ AlsaOutput::Open(AudioFormat &audio_format) #ifndef NDEBUG in_frame_size = audio_format.GetFrameSize(); #endif - out_frame_size = pcm_export->GetFrameSize(audio_format); + out_frame_size = pcm_export->GetFrameSize(); drain = false; diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index f20600d92..bc3e6ff31 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -856,7 +856,7 @@ OSXOutput::Open(AudioFormat &audio_format) if (dop_enabled) { pcm_export->Open(audio_format.format, audio_format.channels, params); ring_buffer_size = std::max(buffer_frame_size, - MPD_OSX_BUFFER_TIME_MS * pcm_export->GetFrameSize(audio_format) * asbd.mSampleRate / 1000); + MPD_OSX_BUFFER_TIME_MS * pcm_export->GetFrameSize() * asbd.mSampleRate / 1000); } #endif ring_buffer = new boost::lockfree::spsc_queue(ring_buffer_size); diff --git a/src/pcm/Export.cxx b/src/pcm/Export.cxx index 99c0ba652..d149643c1 100644 --- a/src/pcm/Export.cxx +++ b/src/pcm/Export.cxx @@ -115,7 +115,7 @@ PcmExport::Reset() noexcept } size_t -PcmExport::GetFrameSize(const AudioFormat &audio_format) const noexcept +PcmExport::GetFrameSize() const noexcept { if (pack24) /* packed 24 bit samples (3 bytes per sample) */ @@ -141,7 +141,7 @@ PcmExport::GetFrameSize(const AudioFormat &audio_format) const noexcept } #endif - return audio_format.GetFrameSize(); + return channels * sample_format_size(src_sample_format); } unsigned diff --git a/src/pcm/Export.hxx b/src/pcm/Export.hxx index 6748c0b88..9ffca3b3a 100644 --- a/src/pcm/Export.hxx +++ b/src/pcm/Export.hxx @@ -188,7 +188,7 @@ public: * Calculate the size of one output frame. */ gcc_pure - size_t GetFrameSize(const AudioFormat &audio_format) const noexcept; + size_t GetFrameSize() const noexcept; /** * Export a PCM buffer.