mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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:
parent
f17f918b75
commit
69c2c46472
1 changed files with 7 additions and 0 deletions
|
@ -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) ||
|
||||
|
|
Loading…
Reference in a new issue