Do not send PreviousLoopback output packets to closed streams

PiperOrigin-RevId: 544449979
This commit is contained in:
MediaPipe Team 2023-06-29 13:42:27 -07:00 committed by Copybara-Service
parent 52cea59d41
commit e15d5a797b

View File

@ -123,7 +123,10 @@ class PreviousLoopbackCalculator : public Node {
// However, LOOP packet is empty. // However, LOOP packet is empty.
kPrevLoop(cc).SetNextTimestampBound(main_spec.timestamp + 1); kPrevLoop(cc).SetNextTimestampBound(main_spec.timestamp + 1);
} else { } else {
kPrevLoop(cc).Send(loop_candidate.At(main_spec.timestamp)); // Avoids sending leftovers to a stream that's already closed.
if (!kPrevLoop(cc).IsClosed()) {
kPrevLoop(cc).Send(loop_candidate.At(main_spec.timestamp));
}
} }
loop_packets_.pop_front(); loop_packets_.pop_front();
main_packet_specs_.pop_front(); main_packet_specs_.pop_front();