wavparse: last audio payload chunk is ignored in push (streaming) mode
In push mode (streaming), if the last audio payload chunk is less than the segment rate buffer size, it would be ignored.
- GStreamer 1.8.3
- Ubuntu 16.04
How to reproduce:
- Run gst-launch with tcp source
gst-launch-1.0 tcpserversrc port=3000 ! wavparse ignore-length=0 ! audioconvert ! filesink location=bug.wav
- Send a wav file with unspecified data chunk length (0). Attached a test file
cat test.wav | nc localhost 3000
- Compare the length of the source file and output file
ls -l test.wav bug.wav -rw-rw-r-- 1 amr amr 61440 Aug 2 12:48 bug.wav -rw-rw-r-- 1 amr amr 65004 Aug 2 12:57 test.wav
The expected length of the result of the gst-lauch pipeline should be the same as the test file minus the headers (44), which is
65004 - 44 = 64960 but the actual output length is
After debugging the issue I noticed that the last chunk of audio is being dropped in push (streaming) mode. I've a fix that I'll send a MR for shortly.