Skip to content

Commit

Permalink
Hopefully fix de-dup setting
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Dec 16, 2023
1 parent 962b83e commit 36fc2f7
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/channeloutput/ArtNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void ArtNetOutputData::PrepareData(unsigned char* channelData, UDPOutputMessages

unsigned char* cur = channelData + startChannel - 1;
int start = 0;
bool skipped = false;
bool anySkipped = false;
bool allSkipped = true;

std::vector<struct mmsghdr>& msgs = messages[ARTNET_DEST_PORT];
Expand All @@ -191,7 +191,7 @@ void ArtNetOutputData::PrepareData(unsigned char* channelData, UDPOutputMessages
anIovecs[x * 2 + 1].iov_base = (void*)cur;
allSkipped = false;
} else {
skipped = true;
anySkipped = true;
}
cur += channelCount;
start += channelCount;
Expand All @@ -200,7 +200,7 @@ void ArtNetOutputData::PrepareData(unsigned char* channelData, UDPOutputMessages
if (sequenceNumber == 0) {
sequenceNumber++;
}
if (skipped) {
if (anySkipped) {
skippedFrames++;
}
if (!allSkipped) {
Expand Down
8 changes: 5 additions & 3 deletions src/channeloutput/DDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void DDPOutputData::PrepareData(unsigned char* channelData, UDPOutputMessages& m

msg.msg_hdr.msg_name = &ddpAddress;
msg.msg_hdr.msg_namelen = sizeof(sockaddr_in);
bool skipped = false;
bool anySkipped = false;
bool allSkipped = true;
for (int p = 0; p < pktCount; p++) {
bool nto = NeedToOutputFrame(channelData, startChannel - 1, start, ddpIovecs[p * 2 + 1].iov_len);
Expand Down Expand Up @@ -225,12 +225,14 @@ void DDPOutputData::PrepareData(unsigned char* channelData, UDPOutputMessages& m
ddpIovecs[p * 2 + 1].iov_base = (void*)(&channelData[startChannel - 1 + start]);
allSkipped = false;
} else {
skipped = true;
anySkipped = true;
}
start += ddpIovecs[p * 2 + 1].iov_len;
}
if (skipped) {
if (anySkipped) {
skippedFrames++;
} else {
skippedFrames = 0;
}
if (!allSkipped) {
SaveFrame(&channelData[startChannel - 1], start);
Expand Down
6 changes: 3 additions & 3 deletions src/channeloutput/E131.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void E131OutputData::PrepareData(unsigned char* channelData, UDPOutputMessages&
if (valid && active) {
unsigned char* cur = channelData + startChannel - 1;
int start = 0;
bool skipped = false;
bool anySkipped = false;
bool allSkipped = true;
for (int x = 0; x < universeCount; x++) {
if (NeedToOutputFrame(channelData, startChannel - 1, start, channelCount)) {
Expand All @@ -188,12 +188,12 @@ void E131OutputData::PrepareData(unsigned char* channelData, UDPOutputMessages&
e131Iovecs[x * 2 + 1].iov_base = (void*)cur;
allSkipped = false;
} else {
skipped = true;
anySkipped = true;
}
cur += channelCount;
start += channelCount;
}
if (skipped) {
if (anySkipped) {
skippedFrames++;
} else {
skippedFrames = 0;
Expand Down
1 change: 1 addition & 0 deletions src/channeloutput/GenericUDPOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class GenericUDPOutputData : public UDPOutputData {
msgs[udpAddress.sin_addr.s_addr].push_back(msg);
}
SaveFrame(&channelData[startChannel - 1], channelCount);
skippedFrames = 0;
} else {
skippedFrames++;
}
Expand Down
8 changes: 5 additions & 3 deletions src/channeloutput/KiNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void KiNetOutputData::PrepareData(unsigned char* channelData, UDPOutputMessages&

msg.msg_hdr.msg_name = &kinetAddress;
msg.msg_hdr.msg_namelen = sizeof(sockaddr_in);
bool skipped = false;
bool anySkipped = false;
bool allSkipped = true;
for (int p = 0; p < portCount; p++) {
bool nto = NeedToOutputFrame(channelData, startChannel - 1, start, kinetIovecs[p * 2 + 1].iov_len);
Expand All @@ -160,12 +160,14 @@ void KiNetOutputData::PrepareData(unsigned char* channelData, UDPOutputMessages&
kinetIovecs[p * 2 + 1].iov_base = (void*)(&channelData[startChannel - 1 + start]);
allSkipped = false;
} else {
skipped = true;
anySkipped = true;
}
start += kinetIovecs[p * 2 + 1].iov_len;
}
if (skipped) {
if (anySkipped) {
skippedFrames++;
} else {
skippedFrames = 0;
}
if (!allSkipped) {
SaveFrame(&channelData[startChannel - 1], start);
Expand Down
8 changes: 5 additions & 3 deletions src/channeloutput/Twinkly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void TwinklyOutputData::PrepareData(unsigned char* channelData, UDPOutputMessage

msg.msg_hdr.msg_name = &twinklyAddress;
msg.msg_hdr.msg_namelen = sizeof(sockaddr_in);
bool skipped = false;
bool anySkipped = false;
bool allSkipped = true;
for (int p = 0; p < portCount; p++) {
bool nto = NeedToOutputFrame(channelData, startChannel - 1, start, twinklyIovecs[p * 2 + 1].iov_len);
Expand All @@ -127,12 +127,14 @@ void TwinklyOutputData::PrepareData(unsigned char* channelData, UDPOutputMessage
twinklyIovecs[p * 2 + 1].iov_base = (void*)(&channelData[startChannel - 1 + start]);
allSkipped = false;
} else {
skipped = true;
anySkipped = true;
}
start += twinklyIovecs[p * 2 + 1].iov_len;
}
if (skipped) {
if (anySkipped) {
skippedFrames++;
} else {
skippedFrames = 0;
}
if (!allSkipped) {
SaveFrame(&channelData[startChannel - 1], start);
Expand Down
1 change: 0 additions & 1 deletion src/channeloutput/UDPOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ bool UDPOutputData::NeedToOutputFrame(unsigned char* channelData, int startChann
}
return false;
}
skippedFrames = 0;
return true;
}

Expand Down

0 comments on commit 36fc2f7

Please sign in to comment.