rtprawdepay: Don't get rid of the buffer pool on FLUSH_STOP

We expect there to be a pool as long as the caps are known and
FLUSH_STOP is not resetting the caps. Getting rid of the pool would
cause assertions.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/584
This commit is contained in:
Sebastian Dröge 2019-05-01 10:00:51 +03:00
parent 037d70c01b
commit c4608b410c

View file

@ -108,7 +108,7 @@ gst_rtp_vraw_depay_init (GstRtpVRawDepay * rtpvrawdepay)
}
static void
gst_rtp_vraw_depay_reset (GstRtpVRawDepay * rtpvrawdepay)
gst_rtp_vraw_depay_reset (GstRtpVRawDepay * rtpvrawdepay, gboolean full)
{
if (rtpvrawdepay->outbuf) {
gst_video_frame_unmap (&rtpvrawdepay->frame);
@ -116,7 +116,8 @@ gst_rtp_vraw_depay_reset (GstRtpVRawDepay * rtpvrawdepay)
rtpvrawdepay->outbuf = NULL;
}
rtpvrawdepay->timestamp = -1;
if (rtpvrawdepay->pool) {
if (full && rtpvrawdepay->pool) {
gst_buffer_pool_set_active (rtpvrawdepay->pool, FALSE);
gst_object_unref (rtpvrawdepay->pool);
rtpvrawdepay->pool = NULL;
@ -613,7 +614,7 @@ gst_rtp_vraw_depay_handle_event (GstRTPBaseDepayload * filter, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_STOP:
gst_rtp_vraw_depay_reset (rtpvrawdepay);
gst_rtp_vraw_depay_reset (rtpvrawdepay, FALSE);
break;
default:
break;
@ -638,7 +639,7 @@ gst_rtp_vraw_depay_change_state (GstElement * element,
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_rtp_vraw_depay_reset (rtpvrawdepay);
gst_rtp_vraw_depay_reset (rtpvrawdepay, TRUE);
break;
default:
break;
@ -648,7 +649,7 @@ gst_rtp_vraw_depay_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_rtp_vraw_depay_reset (rtpvrawdepay);
gst_rtp_vraw_depay_reset (rtpvrawdepay, TRUE);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
break;