Skip to content

Commit

Permalink
Fix AdaptationFieldSize function
Browse files Browse the repository at this point in the history
Use the data() function to get a pointer to access the fifth element of
a transport stream packet instead of directly accessing the fifth element of a
std::array that maps only the first four bytes of the transport stream packet.
  • Loading branch information
kmdewaal committed Jun 4, 2022
1 parent caa0012 commit 0c16cbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mpeg/tspacket.h
Expand Up @@ -95,7 +95,7 @@ class MTV_PUBLIC TSHeader
bool Scrambled(void) const { return bool(m_tsData[3]&0x80); }
bool HasAdaptationField(void) const { return bool(m_tsData[3] & 0x20); }
size_t AdaptationFieldSize(void) const
{ return (HasAdaptationField() ? static_cast<size_t>(m_tsData[4]) : 0); }
{ return (HasAdaptationField() ? static_cast<size_t>(data()[4]) : 0); }
bool HasPayload(void) const { return bool(m_tsData[3] & 0x10); }

bool GetDiscontinuityIndicator(void) const
Expand Down

0 comments on commit 0c16cbd

Please sign in to comment.