-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix false positive "First sound has been moved!" warnings #16054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,17 +72,19 @@ ReaderStatusUpdate CachingReaderWorker::processReadRequest( | |
| } | ||
| } | ||
|
|
||
| // This call here assumes that the caching reader will read the first sound cue at | ||
| // one of the first chunks. The check serves as a sanity check to ensure that the | ||
| // sample data has not changed since it has ben analyzed. This could happen because | ||
| // of a change in actual audio data or because the file was decoded using a different | ||
| // decoder | ||
| // This is part of a first prove of concept and needs to be replaces with a different | ||
| // solution which is still under discussion. This might be also extended | ||
| // to further checks whether a automatic offset adjustment is possible or a the | ||
| // sample position metadata shall be treated as outdated. | ||
| // Failures of the sanity check only result in an entry into the log at the moment. | ||
| verifyFirstSound(pChunk); | ||
| if (status == CHUNK_READ_SUCCESS) { | ||
| // This call here assumes that the caching reader will read the first sound cue at | ||
| // one of the first chunks. The check serves as a sanity check to ensure that the | ||
| // sample data has not changed since it has ben analyzed. This could happen because | ||
| // of a change in actual audio data or because the file was decoded using a different | ||
| // decoder | ||
| // This is part of a first prove of concept and needs to be replaces with a different | ||
| // solution which is still under discussion. This might be also extended | ||
| // to further checks whether a automatic offset adjustment is possible or a the | ||
| // sample position metadata shall be treated as outdated. | ||
| // Failures of the sanity check only result in an entry into the log at the moment. | ||
| verifyFirstSound(pChunk); | ||
| } | ||
|
|
||
| ReaderStatusUpdate result; | ||
| result.init(status, pChunk, m_pAudioSource ? m_pAudioSource->frameIndexRange() : mixxx::IndexRange()); | ||
|
|
@@ -272,9 +274,15 @@ void CachingReaderWorker::verifyFirstSound(const CachingReaderChunk* pChunk) { | |
| .value())); | ||
| if (pChunk->getIndex() == firstSoundIndex) { | ||
| CSAMPLE sampleBuffer[kNumSoundFrameToVerify * mixxx::kEngineChannelCount]; | ||
| SINT end = static_cast<SINT>(m_firstSoundFrameToVerify.toLowerFrameBoundary().value()); | ||
| pChunk->readBufferedSampleFrames(sampleBuffer, | ||
| mixxx::IndexRange::forward(end - 1, kNumSoundFrameToVerify)); | ||
| SINT end = static_cast<SINT>(m_firstSoundFrameToVerify.toLowerFrameBoundary().value()) + 1; | ||
| mixxx::IndexRange probeFrameIndexRange = | ||
| mixxx::IndexRange::between(end - kNumSoundFrameToVerify, end); | ||
| mixxx::IndexRange bufferedFrameIndexRange = | ||
| pChunk->readBufferedSampleFrames( | ||
| sampleBuffer, probeFrameIndexRange); | ||
| VERIFY_OR_DEBUG_ASSERT(bufferedFrameIndexRange == probeFrameIndexRange) { | ||
| return; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I understand, this early return would handle the case where the reader is unable to read the file (e.g IO issues). Since this could technically happen on a release build, could you put a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can no longer happen. That's just an assertion for this assumption. The actual fix has been done via
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I run into this assertion with a very short ogg track (1.74 s) I use for testing. ffprobe finds no issues. When I play a copy of that file, it passes the assertion but still fails to repeat (stops after ~3 rounds)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. Can you file an issue and append the file or send it to me? Than will have a look.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| if (AnalyzerSilence::verifyFirstSound(std::span<const CSAMPLE>(sampleBuffer), | ||
| mixxx::audio::FramePos(1))) { | ||
| qDebug() << "First sound found at the previously stored position"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.