1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Formatting

The documentation specifies that the "Duration" property is given in
100 nanosecond units, which is a good thing, otherwise the calculation
wouldn't be correct.
This commit is contained in:
attila 2024-08-28 17:12:07 +02:00
parent 5b98066a48
commit 0d6b3f0d7d

View file

@ -278,12 +278,12 @@ private:
{
if (auto wmHeaderInfo = wmSyncReader.getInterface<IWMHeaderInfo>())
{
QWORD lengthInNanoseconds = 0;
WORD lengthOfLength = sizeof (lengthInNanoseconds);
QWORD lengthInHundredNanoseconds = 0;
WORD lengthOfLength = sizeof (lengthInHundredNanoseconds);
WORD streamNum = 0;
WMT_ATTR_DATATYPE wmAttrDataType;
wmHeaderInfo->GetAttributeByName (&streamNum, L"Duration", &wmAttrDataType,
(BYTE*) &lengthInNanoseconds, &lengthOfLength);
(BYTE*) &lengthInHundredNanoseconds, &lengthOfLength);
if (auto wmProfile = wmSyncReader.getInterface<IWMProfile>())
{
@ -308,7 +308,7 @@ private:
sampleRate = inputFormat->nSamplesPerSec;
numChannels = inputFormat->nChannels;
bitsPerSample = inputFormat->wBitsPerSample != 0 ? inputFormat->wBitsPerSample : 16;
lengthInSamples = (lengthInNanoseconds * (QWORD) sampleRate) / 10000000;
lengthInSamples = (lengthInHundredNanoseconds * (QWORD) sampleRate) / 10000000;
}
}
}