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
This commit is contained in:
Sebastian Dröge 2013-06-30 18:17:15 +02:00
parent 50fd867a43
commit 85eac2c31c
2 changed files with 18 additions and 4 deletions

View file

@ -2429,8 +2429,15 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
GST_VIDEO_DECODER_STREAM_LOCK (decoder); GST_VIDEO_DECODER_STREAM_LOCK (decoder);
if (G_UNLIKELY (priv->output_state_changed || (priv->output_state if (G_UNLIKELY (priv->output_state_changed || (priv->output_state
&& gst_pad_check_reconfigure (decoder->srcpad)))) && gst_pad_check_reconfigure (decoder->srcpad)))) {
gst_video_decoder_negotiate (decoder); 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); gst_video_decoder_prepare_finish_frame (decoder, frame, FALSE);
priv->processed++; priv->processed++;

View file

@ -1729,8 +1729,15 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder,
GST_VIDEO_ENCODER_STREAM_LOCK (encoder); GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
if (G_UNLIKELY (priv->output_state_changed || (priv->output_state if (G_UNLIKELY (priv->output_state_changed || (priv->output_state
&& gst_pad_check_reconfigure (encoder->srcpad)))) && gst_pad_check_reconfigure (encoder->srcpad)))) {
gst_video_encoder_negotiate (encoder); 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)) if (G_UNLIKELY (priv->output_state == NULL))
goto no_output_state; goto no_output_state;