jpeg2000parse: fix critical log when play one gray colorspace video

Need guess color space based on number of components when cannot
got it from sink caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1955>
This commit is contained in:
Haihua Hu 2021-01-14 14:24:06 +08:00 committed by GStreamer Marge Bot
parent 0633bef05d
commit e69d0151d2

View file

@ -536,7 +536,9 @@ gst_jpeg2000_parse_handle_frame (GstBaseParse * parse,
if (sink_sampling_string)
sink_sampling = gst_jpeg2000_sampling_from_string (sink_sampling_string);
} else {
}
if (colorspace == GST_JPEG2000_COLORSPACE_NONE) {
/* guess color space based on number of components */
if (numcomps == 0 || numcomps > 4) {
GST_ERROR_OBJECT (jpeg2000parse,