opusenc: fix crash when setting "cbr" property when encoder is not running yet

https://bugzilla.gnome.org/show_bug.cgi?id=692698
This commit is contained in:
Tim-Philipp Müller 2013-01-28 14:12:56 +00:00
parent 74d1f8a400
commit 32893dd95e

View file

@ -996,7 +996,8 @@ gst_opus_enc_set_property (GObject * object, guint prop_id,
/* this one has an opposite meaning to the opus ctl... */
g_mutex_lock (&enc->property_lock);
enc->cbr = g_value_get_boolean (value);
opus_multistream_encoder_ctl (enc->state, OPUS_SET_VBR (!enc->cbr));
if (enc->state)
opus_multistream_encoder_ctl (enc->state, OPUS_SET_VBR (!enc->cbr));
g_mutex_unlock (&enc->property_lock);
break;
case PROP_CONSTRAINED_VBR: