X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=reorderer.cpp;h=b6ac6a9079906b8aaac5944ef8398f88fdc341e9;hb=66d3e5110affbc70766211aeff46c4f41e532ed1;hp=fe3b7b64cd98027b4be2b49eab8399ec8618d89c;hpb=b93c68671f62724af6e0b21e4d09af7ca91e9749;p=greproxy diff --git a/reorderer.cpp b/reorderer.cpp index fe3b7b6..b6ac6a9 100644 --- a/reorderer.cpp +++ b/reorderer.cpp @@ -12,7 +12,7 @@ Reorderer::Reorderer(Protocol* sender) { } -void Reorderer::handle_packet(uint16_t proto, const string& data, int seq) +void Reorderer::send_packet(uint16_t proto, const string& data, int seq) { bool silence = false; if (packet_buffer.size() >= PACKET_BUFFER_SIZE) { @@ -43,7 +43,8 @@ void Reorderer::handle_packet(uint16_t proto, const string& data, int seq) // printf("seq=%d\n", front_seq); //} const string &data = packet_buffer.top().data; - send_packet(packet_buffer.top().proto, data, silence); + check_ts_discontinuity(packet_buffer.top().proto, data, silence); + sender->send_packet(proto, data, seq); packet_buffer.pop(); last_seq = front_seq; if (!silence && !packet_buffer.empty()) { @@ -53,7 +54,7 @@ void Reorderer::handle_packet(uint16_t proto, const string& data, int seq) } } -void Reorderer::send_packet(uint16_t proto, const string &data, bool silence) +void Reorderer::check_ts_discontinuity(uint16_t proto, const string &data, bool silence) { if (data.size() == 1344) { for (int i = 0; i < 7; ++i) { @@ -74,6 +75,5 @@ void Reorderer::send_packet(uint16_t proto, const string &data, bool silence) } } } - sender->send_packet(proto, data); }