Skip to content

Commit

Permalink
Fix FecReader block duration estimation roc-streaming#688
Browse files Browse the repository at this point in the history
The whole combination of factor that enabled
the issue are still unclear. The fix is just in
simplifying the logic by disabling estimator for
the blocks with absent first packet, which
should not be a great deal.
Apparently the issue could take place
during start-up transition, and it
basically lead to wrong block length estimation
with two times greater value than correct one.
  • Loading branch information
baranovmv committed Apr 20, 2024
1 parent 96fbd6a commit 0ab9cd7
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/internal_modules/roc_fec/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ status::StatusCode Reader::get_next_packet_(packet::PacketPtr& ptr) {
fill_block_();

packet::PacketPtr pp = source_block_[next_packet_];
if (pp && next_packet_ == 0) {
update_block_duration_(pp);
if (next_packet_ == 0) {
if (pp) {
update_block_duration_(pp);
} else {
prev_block_timestamp_valid_ = false;
}
}

do {
Expand All @@ -162,18 +166,10 @@ status::StatusCode Reader::get_next_packet_(packet::PacketPtr& ptr) {

if (pos == source_block_.size()) {
if (source_queue_.size() == 0) {
prev_block_timestamp_valid_ = false;
return status::StatusNoData;
}
} else {
pp = source_block_[pos++];
if (pp && pos == 1) {
update_block_duration_(pp);
}
}

if (!pp && next_packet_ == 0) {
prev_block_timestamp_valid_ = false;
}
next_packet_ = pos;
} else {
Expand Down

0 comments on commit 0ab9cd7

Please sign in to comment.