audioencoder: don't fail if the start vfunc is not implemented

Fix behaviour to match documentation and decoder class behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=685490
This commit is contained in:
Andoni Morales Alastruey 2012-10-04 14:05:13 +02:00 committed by Tim-Philipp Müller
parent e873435ce0
commit 795d366a0c

View file

@ -1971,8 +1971,12 @@ gst_audio_encoder_activate (GstAudioEncoder * enc, gboolean active)
enc->priv->tags = gst_tag_list_new_empty ();
enc->priv->tags_changed = FALSE;
if (!enc->priv->active && klass->start)
result = klass->start (enc);
if (!enc->priv->active) {
if (klass->start)
result = klass->start (enc);
else
result = TRUE;
}
} else {
/* We must make sure streaming has finished before resetting things
* and calling the ::stop vfunc */