Add deinterlacing function to RageSoundMixBuffer

JACK processes every channel separately, so we need this.  The audio data is
interlaced all the way back at RageSound::GetDataToPlay(), so this is an easier
hack for now than using deinterlaced until it's needed.
This commit is contained in:
Devin J. Pohly
2013-08-08 13:24:21 -04:00
parent f9208e1276
commit deab7e6f47
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -90,6 +90,14 @@ void RageSoundMixBuffer::read( float *pBuf )
m_iBufUsed = 0;
}
void RageSoundMixBuffer::read_deinterlace( float **pBufs, int channels )
{
for( int i = 0; i < m_iBufUsed; ++i )
for( int ch = 0; ch < channels; ++ch )
pBufs[ch][i] = m_pMixbuf[channels * i + ch];
m_iBufUsed = 0;
}
/*
* Copyright (c) 2002-2004 Glenn Maynard
* All rights reserved.
+1
View File
@@ -17,6 +17,7 @@ public:
void read( int16_t *pBuf );
void read( float *pBuf );
void read_deinterlace( float **pBufs, int channels );
float *read() { return m_pMixbuf; }
unsigned size() const { return m_iBufUsed; }
void SetWriteOffset( int iOffset );