Lost asf packets with repeating sequence numbering
Streaming asf causes "detected packet loss (x != y) messages being shown on client every so and often, where x and y sequence numbers differ by a certain value based on configured asf packet size. For asf packet size of 1400, the difference is always 715, for 8000 it's 125 and for 16000 it's 65.
As the size of missing sequence numbers is always same, it points to an issue in buffering after encoding dropping packets or replacing yet to be sent out packets with later encoding. To find the exact location where this is happening, adding debugging to following functions should help:
- Mux() of mux/asf.c,
- sout_MuxSendBuffer() of stream_output/stream_output.c,
- sout_AccessOutWrite() of stream_output/stream_output.c,
- Write() of access_output/http.c,
- httpd_StreamSend() of network/httpd.c and
- httpd_HostThread() of network/httpd.c.
This should be fixed asap because it affects every codec used in asf, with some having more visible effects than others.
Another issue with the detection is missing signaling to/on client to prevent feeding the decoder with truncated data caused by lost packets. There should be a way to wait until valid state (packet starting next (key)frame) is received before feeding the decoder again.