rtpbasepayload: Ensure to set the RECONFIGURE flag again if reconfiguration failed

https://bugzilla.gnome.org/show_bug.cgi?id=774623
This commit is contained in:
Sebastian Dröge 2016-11-17 19:46:54 +02:00
parent abf1f23d54
commit b9f59fd999

View file

@ -656,8 +656,16 @@ gst_rtp_base_payload_chain (GstPad * pad, GstObject * parent,
if (!rtpbasepayload->priv->negotiated)
goto not_negotiated;
if (gst_pad_check_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (rtpbasepayload)))
gst_rtp_base_payload_negotiate (rtpbasepayload);
if (gst_pad_check_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (rtpbasepayload))) {
if (!gst_rtp_base_payload_negotiate (rtpbasepayload)) {
gst_pad_mark_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (rtpbasepayload));
if (GST_PAD_IS_FLUSHING (GST_RTP_BASE_PAYLOAD_SRCPAD (rtpbasepayload))) {
goto flushing;
} else {
goto negotiate_failed;
}
}
}
ret = rtpbasepayload_class->handle_buffer (rtpbasepayload, buffer);
@ -679,6 +687,18 @@ not_negotiated:
gst_buffer_unref (buffer);
return GST_FLOW_NOT_NEGOTIATED;
}
negotiate_failed:
{
GST_DEBUG_OBJECT (rtpbasepayload, "Not negotiated");
gst_buffer_unref (buffer);
return GST_FLOW_NOT_NEGOTIATED;
}
flushing:
{
GST_DEBUG_OBJECT (rtpbasepayload, "we are flushing");
gst_buffer_unref (buffer);
return GST_FLOW_FLUSHING;
}
}
/**
@ -827,7 +847,8 @@ gst_rtp_base_payload_negotiate (GstRTPBasePayload * payload)
if (gst_caps_is_empty (temp)) {
gst_caps_unref (temp);
gst_caps_unref (templ);
return FALSE;
res = FALSE;
goto out;
}
/* We prefer the pt, timestamp-offset, seqnum-offset from the
@ -1070,6 +1091,11 @@ gst_rtp_base_payload_negotiate (GstRTPBasePayload * payload)
gst_caps_unref (srccaps);
gst_caps_unref (templ);
out:
if (!res)
gst_pad_mark_reconfigure (GST_RTP_BASE_PAYLOAD_SRCPAD (payload));
return res;
}