Fix frame variable count when varying frame lengths
The frame variable count should be minimum of frame count and frame length range size. Unrelated, in case of random payload pattern, reuse StreamBase::frameCount() which does the same calculation. Fixes #325
This commit is contained in:
parent
5edf9a75e5
commit
a352ff3ed1
@ -232,24 +232,9 @@ int PayloadProtocol::protocolFrameVariableCount() const
|
||||
int count = AbstractProtocol::protocolFrameVariableCount();
|
||||
|
||||
if (data.pattern_mode() == OstProto::Payload::e_dp_random)
|
||||
{
|
||||
switch(mpStream->sendUnit())
|
||||
{
|
||||
case OstProto::StreamControl::e_su_packets:
|
||||
return mpStream->numPackets();
|
||||
return mpStream->frameCount();
|
||||
|
||||
case OstProto::StreamControl::e_su_bursts:
|
||||
return int(mpStream->numBursts()
|
||||
* mpStream->burstSize()
|
||||
* mpStream->burstRate());
|
||||
}
|
||||
}
|
||||
|
||||
if (mpStream->lenMode() != StreamBase::e_fl_fixed)
|
||||
{
|
||||
count = AbstractProtocol::lcm(count,
|
||||
mpStream->frameLenMax() - mpStream->frameLenMin() + 1);
|
||||
}
|
||||
count = AbstractProtocol::lcm(count, mpStream->frameSizeVariableCount());
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ int StreamBase::frameSizeVariableCount() const
|
||||
case OstProto::StreamCore::e_fl_inc:
|
||||
case OstProto::StreamCore::e_fl_dec:
|
||||
case OstProto::StreamCore::e_fl_random:
|
||||
count = frameLenMax() - frameLenMin() + 1;
|
||||
count = qMin(frameLenMax() - frameLenMin() + 1, frameCount());
|
||||
break;
|
||||
default:
|
||||
qWarning("%s: Unhandled len mode %d", __FUNCTION__, lenMode());
|
||||
|
Loading…
Reference in New Issue
Block a user