From cdb22274e634644e3d42303e6c09042cc940a9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 4 Oct 2012 13:40:32 +0100 Subject: [PATCH] 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 --- gst-libs/gst/audio/gstaudioencoder.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 73a5f3748d..27a4f0a597 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -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 */