mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-11-13 07:17:28 +00:00
[idd] network: finish fragmented video frames
Preserve a partially transmitted frame while replacing queued stale frames. Continuous capture can otherwise discard every frame before the client receives its final fragment.
This commit is contained in:
@@ -1609,8 +1609,21 @@ struct CNetworkVideo::Impl
|
|||||||
|
|
||||||
void DropPeerFramesNL(PeerState& peer)
|
void DropPeerFramesNL(PeerState& peer)
|
||||||
{
|
{
|
||||||
|
// Finish a frame once any of its fragments have been accepted. Replacing
|
||||||
|
// it mid-flight prevents a continuously changing desktop from ever
|
||||||
|
// delivering a complete frame on a constrained link.
|
||||||
|
uint64_t activeFrame = 0;
|
||||||
|
for (const SendItem& item : m_sends)
|
||||||
|
if (item.frameID && item.encoded && item.fragmentIndex &&
|
||||||
|
SamePeer(item.peer, peer.peer))
|
||||||
|
{
|
||||||
|
activeFrame = item.frameID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto item = m_sends.begin(); item != m_sends.end();)
|
for (auto item = m_sends.begin(); item != m_sends.end();)
|
||||||
if (item->frameID && SamePeer(item->peer, peer.peer))
|
if (item->frameID && item->frameID != activeFrame &&
|
||||||
|
SamePeer(item->peer, peer.peer))
|
||||||
{
|
{
|
||||||
ReleaseSendAccountingNL(*item);
|
ReleaseSendAccountingNL(*item);
|
||||||
item = m_sends.erase(item);
|
item = m_sends.erase(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user