From d508a744da25458f6bd31d7d0c635a024d2ff067 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 9 Mar 2021 01:21:53 +0100 Subject: [PATCH] SoundSourceMediaFoundation: Disable debug assertion --- src/sources/soundsourcemediafoundation.cpp | 43 +++++++++++----------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/sources/soundsourcemediafoundation.cpp b/src/sources/soundsourcemediafoundation.cpp index 74cfc5f6436..5da31ba401a 100644 --- a/src/sources/soundsourcemediafoundation.cpp +++ b/src/sources/soundsourcemediafoundation.cpp @@ -370,30 +370,31 @@ ReadableSampleFrames SoundSourceMediaFoundation::readSampleFramesClamped( } DEBUG_ASSERT(pSample != nullptr); SINT readerFrameIndex = m_streamUnitConverter.toFrameIndex(streamPos); + // TODO: Fix debug assertion in else arm. It has been commented + // out deliberately to prevent crashes in debug builds. + // https://bugs.launchpad.net/mixxx/+bug/1899242 if (m_currentFrameIndex == kUnknownFrameIndex) { // Unknown position after seeking m_currentFrameIndex = readerFrameIndex; - /* - kLogger.debug() - << "Stream position (in sample frames) after seeking:" - << "target =" << writableSampleFrames.frameIndexRange().end() - << "current =" << readerFrameIndex; - */ - } else { - // Both positions should match, otherwise readerFrameIndex - // is inaccurate due to rounding errors after conversion from - // stream units to frames! But if this ever happens we better - // trust m_currentFrameIndex that is continuously updated while - // reading in forward direction. - VERIFY_OR_DEBUG_ASSERT(m_currentFrameIndex == readerFrameIndex) { - kLogger.debug() - << "streamPos [100 ns] =" << streamPos - << ", sampleRate =" << getSignalInfo().getSampleRate(); - kLogger.warning() - << "Stream position (in sample frames) while reading is inaccurate:" - << "expected =" << m_currentFrameIndex - << "actual =" << readerFrameIndex; - } + // kLogger.debug() + // << "Stream position (in sample frames) after seeking:" + // << "target =" << writableSampleFrames.frameIndexRange().end() + // << "current =" << readerFrameIndex; + // } else { + // // Both positions should match, otherwise readerFrameIndex + // // is inaccurate due to rounding errors after conversion from + // // stream units to frames! But if this ever happens we better + // // trust m_currentFrameIndex that is continuously updated while + // // reading in forward direction. + // VERIFY_OR_DEBUG_ASSERT(m_currentFrameIndex == readerFrameIndex) { + // kLogger.debug() + // << "streamPos [100 ns] =" << streamPos + // << ", sampleRate =" << getSignalInfo().getSampleRate(); + // kLogger.warning() + // << "Stream position (in sample frames) while reading is inaccurate:" + // << "expected =" << m_currentFrameIndex + // << "actual =" << readerFrameIndex; + // } } DWORD dwSampleBufferCount = 0;