Skip to content

Commit

Permalink
Merge pull request #3680 from uklotzde/soundsourcemediafoundation
Browse files Browse the repository at this point in the history
SoundSourceMediaFoundation: Disable debug assertion
  • Loading branch information
Be-ing authored Mar 9, 2021
2 parents f9a7f03 + d508a74 commit 46337b9
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions src/sources/soundsourcemediafoundation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 46337b9

Please sign in to comment.