From 982d9e2dbc2f3456b015467e20cdcb4e352cbaf2 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Thu, 8 Aug 2013 13:30:39 -0400 Subject: [PATCH] Add MixDeinterlaced to RageSoundDriver This complements the read_deinterlace function just added. --- src/arch/Sound/RageSoundDriver.h | 2 ++ src/arch/Sound/RageSoundDriver_Generic_Software.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/arch/Sound/RageSoundDriver.h b/src/arch/Sound/RageSoundDriver.h index a377e10f0d..c2b230926b 100644 --- a/src/arch/Sound/RageSoundDriver.h +++ b/src/arch/Sound/RageSoundDriver.h @@ -94,6 +94,8 @@ protected: void Mix( int16_t *pBuf, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ); void Mix( float *pBuf, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ); + void MixDeinterlaced( float **pBufs, int channels, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ); + private: /* This mutex is used for serializing with the decoder thread. Locking this mutex * can take a while. */ diff --git a/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 3b9db11cb6..a35a71d74d 100644 --- a/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -170,6 +170,13 @@ void RageSoundDriver::Mix( float *pBuf, int iFrames, int64_t iFrameNumber, int64 MixIntoBuffer( iFrames, iFrameNumber, iCurrentFrame ).read( pBuf ); } +void RageSoundDriver::MixDeinterlaced( float **pBufs, int channels, int iFrames, int64_t iFrameNumber, int64_t iCurrentFrame ) +{ + for (int i = 0; i < channels; ++i ) + memset( pBufs[i], 0, iFrames*sizeof(float) ); + MixIntoBuffer( iFrames, iFrameNumber, iCurrentFrame ).read_deinterlace( pBufs, channels ); +} + void RageSoundDriver::DecodeThread() { SetupDecodingThread();