Merge pull request #213 from narspt/patch-16

fix frame sequence for streams initiated on different mode
This commit is contained in:
LX3JL 2023-03-01 18:25:32 +01:00 committed by GitHub
commit 19b13dfc8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -174,7 +174,10 @@ void CPacket::UpdatePids(uint32 pid)
}
if ( m_uiYsfPacketFrameId == 0xFF )
{
m_uiYsfPacketFrameId = ((pid / 5) & 0x7FU) << 1;
if (IsDvHeader())
m_uiYsfPacketFrameId = 0;
else
m_uiYsfPacketFrameId = (((pid / 5) + 1) & 0x7FU) << 1;
}
// imrs pid needs update ?
if ( m_uiImrsPacketId == 0xFF )
@ -184,6 +187,9 @@ void CPacket::UpdatePids(uint32 pid)
}
if ( m_uiImrsPacketFrameId == 0xFFFF )
{
m_uiImrsPacketFrameId = LOWORD(pid / 5);
if (IsDvHeader())
m_uiImrsPacketFrameId = 0;
else
m_uiImrsPacketFrameId = LOWORD((pid / 5) + 1);
}
}

View file

@ -77,7 +77,8 @@ void CPacketStream::Push(CPacket *Packet)
{
// update stream dependent packet data
m_LastPacketTime.Now();
Packet->UpdatePids(m_uiPacketCntr++);
Packet->UpdatePids(m_uiPacketCntr);
if (Packet->IsDvFrame()) { m_uiPacketCntr++; }
// transcoder avaliable ?
if ( m_CodecStream != NULL )
{