Avoid abusing OggPage header flags to store whether last segment unconcluded
This commit is contained in:
parent
5745632af7
commit
a5ab3ed1b2
|
@ -62,7 +62,7 @@ void OggPage::parseHeader(istream &stream, std::uint64_t startOffset, std::int32
|
||||||
if (++i < m_segmentCount && entry < 0xFF) {
|
if (++i < m_segmentCount && entry < 0xFF) {
|
||||||
m_segmentSizes.emplace_back(0);
|
m_segmentSizes.emplace_back(0);
|
||||||
} else if (i == m_segmentCount && entry == 0xFF) {
|
} 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
|
// check whether the maximum size is exceeded
|
||||||
|
|
|
@ -48,6 +48,7 @@ private:
|
||||||
std::uint32_t m_sequenceNumber;
|
std::uint32_t m_sequenceNumber;
|
||||||
std::uint32_t m_checksum;
|
std::uint32_t m_checksum;
|
||||||
std::uint8_t m_segmentCount;
|
std::uint8_t m_segmentCount;
|
||||||
|
bool m_lastSegmentUnconcluded;
|
||||||
std::vector<std::uint32_t> m_segmentSizes;
|
std::vector<std::uint32_t> m_segmentSizes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ inline OggPage::OggPage()
|
||||||
, m_sequenceNumber(0)
|
, m_sequenceNumber(0)
|
||||||
, m_checksum(0)
|
, m_checksum(0)
|
||||||
, m_segmentCount(0)
|
, m_segmentCount(0)
|
||||||
|
, m_lastSegmentUnconcluded(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +136,7 @@ inline bool OggPage::isLastPage() const
|
||||||
*/
|
*/
|
||||||
inline bool OggPage::isLastSegmentUnconcluded() const
|
inline bool OggPage::isLastSegmentUnconcluded() const
|
||||||
{
|
{
|
||||||
return m_headerTypeFlag & 0x80;
|
return m_lastSegmentUnconcluded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in New Issue