theoraenc: Do nothing when flushing the encoder when no caps were set

In case we receive a flush event before having our caps set, we will
end up trying to create a theora encoder even though we are not ready.
Avoid that situation making sure we are initialized before accepting to
be flushed.

https://bugzilla.gnome.org/show_bug.cgi?id=709858
This commit is contained in:
Thibault Saunier 2013-10-10 15:56:32 -03:00
parent 2b45196042
commit 508245dfa6

View file

@ -364,6 +364,13 @@ theora_enc_flush (GstVideoEncoder * encoder)
ogg_uint32_t keyframe_force;
int rate_flags;
if (enc->input_state == NULL) {
GST_INFO_OBJECT (enc, "Not configured yet, returning FALSE");
return FALSE;
}
GST_OBJECT_LOCK (enc);
enc->info.target_bitrate = enc->video_bitrate;
enc->info.quality = enc->video_quality;