From 10811d63f973a2872e0e684a795d1db49eca65c3 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Fri, 4 Nov 2011 11:10:46 +0000 Subject: [PATCH] theoraenc: refuse to get to READY if the encoder was disabled https://bugzilla.gnome.org/show_bug.cgi?id=663391 --- ext/theora/gsttheoraenc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index cae79db..b7cd8ae 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -1405,11 +1405,19 @@ theora_enc_change_state (GstElement * element, GstStateChange transition) { GstTheoraEnc *enc; GstStateChangeReturn ret; + th_enc_ctx *th_ctx; enc = GST_THEORA_ENC (element); switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: + th_ctx = dummy_encode_ctx (); + if (!th_ctx) { + GST_ELEMENT_ERROR (enc, STREAM, ENCODE, (NULL), + ("libtheora has been compiled with the encoder disabled")); + return GST_STATE_CHANGE_FAILURE; + } + th_encode_free (th_ctx); break; case GST_STATE_CHANGE_READY_TO_PAUSED: GST_DEBUG_OBJECT (enc, "READY->PAUSED Initing theora state"); -- 2.7.4