rtpvp9depay: detect incomplete frames and bail out

If a packet with the B bit set arrives but we haven't received
a packet with the marker or E bits set to end the previous frame,
we know the current frame was incomplete.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/769>
This commit is contained in:
Knut Saastad 2020-10-14 23:17:53 +02:00 committed by Mathieu Duponchelle
parent 346b077ae0
commit b22514d469

View file

@ -313,6 +313,15 @@ gst_rtp_vp9_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
if (G_UNLIKELY (hdrsize >= size)) if (G_UNLIKELY (hdrsize >= size))
goto too_small; goto too_small;
/* If this is a start frame AND we are already processing a frame, we need to flush and wait for next start frame */
if (b_bit) {
if (G_UNLIKELY (self->started)) {
GST_DEBUG_OBJECT (depay, "Incomplete frame, flushing adapter");
gst_adapter_clear (self->adapter);
self->started = FALSE;
}
}
if (G_UNLIKELY (!self->started)) { if (G_UNLIKELY (!self->started)) {
/* Check if this is the start of a VP9 layer frame, otherwise bail */ /* Check if this is the start of a VP9 layer frame, otherwise bail */
if (!b_bit) { if (!b_bit) {