audioencoder: invalidate format info when setup negotiation failed

... which ensures nothing subsequently tries to slip past _chain
and into a possibly improperly setup subclass.
This commit is contained in:
Mark Nauwelaerts 2011-11-16 19:00:30 +01:00
parent f17f918b75
commit 69c2c46472

View file

@ -1073,6 +1073,13 @@ gst_audio_encoder_sink_setcaps (GstPad * pad, GstCaps * caps)
if (klass->set_format)
res = klass->set_format (enc, state);
/* invalidate state to ensure no casual carrying on */
if (!res) {
GST_DEBUG_OBJECT (enc, "subclass did not accept format");
gst_audio_info_clear (state);
goto exit;
}
/* notify if new latency */
GST_OBJECT_LOCK (enc);
if ((ctx->min_latency > 0 && ctx->min_latency != old_min_latency) ||