videoencoder: There's no point in resetting the encoder when the caps change

The subclass will be called with set_format() and there it can drain
if necessary and reset whatever is necessary. This is the same behaviour
as for the video decoder.
This commit is contained in:
Sebastian Dröge 2013-07-25 10:53:14 +02:00
parent 291b05b40a
commit c24995c31c

View file

@ -485,23 +485,6 @@ gst_video_encoder_set_headers (GstVideoEncoder * video_encoder, GList * headers)
GST_VIDEO_ENCODER_STREAM_UNLOCK (video_encoder);
}
static gboolean
gst_video_encoder_drain (GstVideoEncoder * enc)
{
GstVideoEncoderPrivate *priv;
priv = enc->priv;
GST_DEBUG_OBJECT (enc, "draining");
if (priv->drained) {
GST_DEBUG_OBJECT (enc, "already drained");
return TRUE;
}
return gst_video_encoder_reset (enc, FALSE);
}
static GstVideoCodecState *
_new_output_state (GstCaps * caps, GstVideoCodecState * reference)
{
@ -592,9 +575,6 @@ gst_video_encoder_setcaps (GstVideoEncoder * encoder, GstCaps * caps)
goto caps_not_changed;
}
/* arrange draining pending frames */
gst_video_encoder_drain (encoder);
/* and subclass should be ready to configure format at any time around */
ret = encoder_class->set_format (encoder, state);
if (ret) {