From: Sebastian Dröge Date: Sun, 30 Jun 2013 16:17:15 +0000 (+0200) Subject: video(enc|dec)oder: Don't return not-negotiated if flushing X-Git-Tag: 1.19.3~511^2~5230 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85eac2c31ce7f7ed2aa0dbd4a9dc2ad42b734788;p=platform%2Fupstream%2Fgstreamer.git video(enc|dec)oder: Don't return not-negotiated if flushing If the pad is flushing after a failed negotiation, return GST_FLOW_FLUSHING instead from finish_frame(). https://bugzilla.gnome.org/show_bug.cgi?id=701763 --- diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 1f392e3..8ca74d5 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -2429,8 +2429,15 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder, GST_VIDEO_DECODER_STREAM_LOCK (decoder); if (G_UNLIKELY (priv->output_state_changed || (priv->output_state - && gst_pad_check_reconfigure (decoder->srcpad)))) - gst_video_decoder_negotiate (decoder); + && gst_pad_check_reconfigure (decoder->srcpad)))) { + if (!gst_video_decoder_negotiate (decoder)) { + if (GST_PAD_IS_FLUSHING (decoder->srcpad)) + ret = GST_FLOW_FLUSHING; + else + ret = GST_FLOW_NOT_NEGOTIATED; + goto done; + } + } gst_video_decoder_prepare_finish_frame (decoder, frame, FALSE); priv->processed++; diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c index dff8b19..dd5b8c3 100644 --- a/gst-libs/gst/video/gstvideoencoder.c +++ b/gst-libs/gst/video/gstvideoencoder.c @@ -1729,8 +1729,15 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder, GST_VIDEO_ENCODER_STREAM_LOCK (encoder); if (G_UNLIKELY (priv->output_state_changed || (priv->output_state - && gst_pad_check_reconfigure (encoder->srcpad)))) - gst_video_encoder_negotiate (encoder); + && gst_pad_check_reconfigure (encoder->srcpad)))) { + if (!gst_video_encoder_negotiate (encoder)) { + if (GST_PAD_IS_FLUSHING (encoder->srcpad)) + ret = GST_FLOW_FLUSHING; + else + ret = GST_FLOW_NOT_NEGOTIATED; + goto done; + } + } if (G_UNLIKELY (priv->output_state == NULL)) goto no_output_state;