Avoid abusing OggPage header flags to store whether last segment unconcluded

This commit is contained in:
Martchus 2023-05-16 23:18:27 +02:00
parent 5745632af7
commit a5ab3ed1b2
2 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,7 @@ void OggPage::parseHeader(istream &stream, std::uint64_t startOffset, std::int32
if (++i < m_segmentCount && entry < 0xFF) {
m_segmentSizes.emplace_back(0);
} else if (i == m_segmentCount && entry == 0xFF) {
m_headerTypeFlag |= 0x80; // FIXME v11: don't abuse header type flags
m_lastSegmentUnconcluded = true;
}
}
// check whether the maximum size is exceeded

View File

@ -48,6 +48,7 @@ private:
std::uint32_t m_sequenceNumber;
std::uint32_t m_checksum;
std::uint8_t m_segmentCount;
bool m_lastSegmentUnconcluded;
std::vector<std::uint32_t> m_segmentSizes;
};
@ -63,6 +64,7 @@ inline OggPage::OggPage()
, m_sequenceNumber(0)
, m_checksum(0)
, m_segmentCount(0)
, m_lastSegmentUnconcluded(false)
{
}
@ -134,7 +136,7 @@ inline bool OggPage::isLastPage() const
*/
inline bool OggPage::isLastSegmentUnconcluded() const
{
return m_headerTypeFlag & 0x80;
return m_lastSegmentUnconcluded;
}
/*!