Skip to content

Commit

Permalink
tidy: Push INCR_CC macro into the only place it is called.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Jul 10, 2022
1 parent 71e1ab2 commit 83e7e8e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mythtv/libs/libmythtv/mpeg/pespacket.cpp
Expand Up @@ -121,7 +121,6 @@ bool PESPacket::AddTSPacket(const TSPacket* packet, int cardid, bool &broken)
*/
void PESPacket::GetAsTSPackets(std::vector<TSPacket> &output, uint cc) const
{
#define INCR_CC(_CC_) do { (_CC_) = ((_CC_) + 1) & 0xf; } while (false)
uint last_byte_of_pesdata = Length() + 4 - 1;
uint size = last_byte_of_pesdata + m_pesData - m_fullBuffer;

Expand All @@ -148,7 +147,7 @@ void PESPacket::GetAsTSPackets(std::vector<TSPacket> &output, uint cc) const
size -= TSPacket::kSize;
while (size > 0)
{
INCR_CC(cc);
cc = (cc + 1) & 0xF;
header.SetContinuityCounter(cc);
output.resize(output.size()+1);
output[output.size()-1].InitHeader(header.data());
Expand All @@ -157,7 +156,6 @@ void PESPacket::GetAsTSPackets(std::vector<TSPacket> &output, uint cc) const
data += write_size;
size -= write_size;
}
#undef INCR_CC
}

uint PESPacket::CalcCRC(void) const
Expand Down

0 comments on commit 83e7e8e

Please sign in to comment.