audioencoder: make stop() vfunc also optional

Just change default value, since we also don't want to fail
if we want to deactivate and aren't active or want to activate
and are already active.

https://bugzilla.gnome.org/show_bug.cgi?id=685490
This commit is contained in:
Tim-Philipp Müller 2012-10-04 13:40:32 +01:00
parent 795d366a0c
commit cdb22274e6

View file

@ -1956,7 +1956,7 @@ static gboolean
gst_audio_encoder_activate (GstAudioEncoder * enc, gboolean active)
{
GstAudioEncoderClass *klass;
gboolean result = FALSE;
gboolean result = TRUE;
klass = GST_AUDIO_ENCODER_GET_CLASS (enc);
@ -1971,12 +1971,8 @@ 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) {
if (klass->start)
result = klass->start (enc);
else
result = TRUE;
}
if (!enc->priv->active && klass->start)
result = klass->start (enc);
} else {
/* We must make sure streaming has finished before resetting things
* and calling the ::stop vfunc */