tsdemux: Hang when ts packets including opus are lost
In a chain coded in C, a TS stream including MPEG4 video +Opus audio is transmitted on UDP on a local ethernet. After some losses (which seem to be on TS packets including opus encoded data) the output video and audio hang and the following message shows up.
ERROR tsdemux tsdemux.c:2833:parse_opus_access_unit: Failed to parse Opus access unit
After some debugging, I know that what causes the error is this line of code:
if (gst_byte_reader_get_remaining (&reader) < packet_size) goto error;
The chain is code in C, but it resembles this commandline chain:
udpsrc port=5000 ! application/x-rtp,media=video,encoding-name=mp2t,clock-rate=90000 ! rtpjitterbuffer latency=1000 ! rtpmp2tdepay ! tsdemux name=mux ! queue ! h264parse ! vaapih264dec ! videoconvert ! autovideosink mux. ! queue ! opusdec ! alsasink
gst-inspect-1.0 version 1.17.0 GStreamer 1.17.0 (GIT) Unknown package origin
But I replaced the relevant codes in tsdemux and around to match the master on github, and nothing changed.