From 8ba485e49df75fd84c74c57f2252741a88ae4792 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Fri, 24 Feb 2023 21:27:27 +0800 Subject: [PATCH] vp8decoder: fail early if no input caps have been provided The vp8decoder class does not implement the ->parse() virtual function, it can only accepts frame aligned data. If some element such as filesrc feed it with unaligned data, the behaviour is undecided. So we should set_needs_format of the decoder to TRUE, then 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/gstvp8decoder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c index 97d72fa03d..411f27281e 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c @@ -102,6 +102,7 @@ static void gst_vp8_decoder_init (GstVp8Decoder * self) { gst_video_decoder_set_packetized (GST_VIDEO_DECODER (self), TRUE); + gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (self), TRUE); self->priv = gst_vp8_decoder_get_instance_private (self); }