Cortex: Use bytes_per_frame in another case.

No functional change.
This commit is contained in:
Augustin Cavalier
2021-09-07 16:14:25 -04:00
parent 3a7aca9728
commit 3006aae081
@@ -37,6 +37,7 @@
#include <Debug.h> #include <Debug.h>
#include <RealtimeAlloc.h> #include <RealtimeAlloc.h>
#include "AudioBuffer.h" #include "AudioBuffer.h"
#include "SoundUtils.h"
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
@@ -105,13 +106,12 @@ AudioBuffer::AudioBuffer(
m_format(format) m_format(format)
{ {
if(pBuffer->Header()->type != B_MEDIA_RAW_AUDIO) if(pBuffer->Header()->type != B_MEDIA_RAW_AUDIO)
return; return;
// reference it: // reference it:
m_pData = pBuffer->Data(); m_pData = pBuffer->Data();
m_frameSize = (m_format.format & 0x0f) * m_format.channel_count; m_frameSize = bytes_per_frame(m_format);
m_frames = pBuffer->Header()->size_used / m_frameSize; m_frames = pBuffer->Header()->size_used / m_frameSize;
m_allocatedSize = 0; m_allocatedSize = 0;
m_bOwnData = false; m_bOwnData = false;