audioencoder: Call reset() before the start() vfunc to guarantee a clean state

The same was done already in the decoder, and we cleaned some state just above
manually that would also be taken care of by reset().

This makes sure that the element is in the same state before start() is called
the very first time and every future call after the element was used already.
This commit is contained in:
Sebastian Dröge 2014-12-22 11:36:58 +01:00
parent 098b42f36b
commit aae6400962

View file

@ -1941,11 +1941,8 @@ gst_audio_encoder_activate (GstAudioEncoder * enc, gboolean active)
GST_DEBUG_OBJECT (enc, "activate %d", active);
if (active) {
if (enc->priv->tags)
gst_tag_list_unref (enc->priv->tags);
enc->priv->tags = gst_tag_list_new_empty ();
enc->priv->tags_changed = FALSE;
/* arrange clean state */
gst_audio_encoder_reset (enc, TRUE);
if (!enc->priv->active && klass->start)
result = klass->start (enc);