From 76585b3a05f79c5f9b1f94e9dd25fc56db82e9b4 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Fri, 24 Feb 2023 21:49:27 +0800 Subject: [PATCH] av1decoder: fail early if no input caps have been provided The av1decoder class does not implement the ->parse() virtual function, and we always need to add the av1parse element before it. So we should set_needs_format of the decoder to TRUE, then if no parse before it, it can fail with a "not-negotiated" error early, rather than go on and generate unexpected error. Part-of: --- subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c index 019437e7d8..983389831e 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c @@ -119,6 +119,7 @@ gst_av1_decoder_init (GstAV1Decoder * self) GstAV1DecoderPrivate *priv; gst_video_decoder_set_packetized (GST_VIDEO_DECODER (self), TRUE); + gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (self), TRUE); self->priv = priv = gst_av1_decoder_get_instance_private (self);