Commit c205ceda authored by Joaquin Muguerza's avatar Joaquin Muguerza Committed by Aurélien Delrieu

Fix bug with calculation of BBFrame size

Fix Issue #36
parent e9a2e3b7
......@@ -749,15 +749,19 @@ error:
unsigned int ForwardSchedulingS2::getBBFrameSizeBytes(unsigned int modcod_id)
{
// if there is no incomplete BB frame create a new one
size_t bbframe_size_bytes;
string coding_rate;
// get the payload size
coding_rate = this->fwd_modcod_def->getCodingRate(modcod_id);
bbframe_size_bytes = getPayloadSize(coding_rate);
return bbframe_size_bytes;
FmtDefinition *fmt_def = this->fwd_modcod_def->getDefinition(modcod_id);
if(fmt_def == NULL)
{
// TODO: remove default value. Calling methods should check that return
// value is OK.
size_t bbframe_size = getPayloadSize("");
LOG(this->log_scheduling, LEVEL_ERROR,
"could not find fmt definition with id %u, use bbframe size %u bytes",
modcod_id, bbframe_size);
return bbframe_size;
}
return getPayloadSize(fmt_def->getCoding());
}
......
......@@ -689,15 +689,19 @@ error:
unsigned int ScpcScheduling::getBBFrameSizeBytes(fmt_id_t modcod_id)
{
// if there is no incomplete BB frame create a new one
size_t bbframe_size_bytes;
string coding_rate;
// get the payload size
coding_rate = this->scpc_modcod_def->getCodingRate(modcod_id);
bbframe_size_bytes = getPayloadSize(coding_rate);
return bbframe_size_bytes;
FmtDefinition *fmt_def = this->scpc_modcod_def->getDefinition(modcod_id);
if(fmt_def == NULL)
{
// TODO: remove default value. Calling methods should check that return
// value is OK.
size_t bbframe_size = getPayloadSize("");
LOG(this->log_scheduling, LEVEL_ERROR,
"could not find fmt definition with id %u, use bbframe size %u bytes",
modcod_id, bbframe_size);
return bbframe_size;
}
return getPayloadSize(fmt_def->getCoding());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment