From 66b176322ca7ee019d1b27e4b59d607b1c870c6b Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 30 Mar 2021 19:23:12 +0900 Subject: [PATCH] ivfparse: Don't set zero resolution on caps It could be zero if the information is not available at ivfparse side, or not implemented. In that case, simply don't set width/height on caps, otherwise downstream would be confused Part-of: --- subprojects/gst-plugins-bad/gst/ivfparse/gstivfparse.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/ivfparse/gstivfparse.c b/subprojects/gst-plugins-bad/gst/ivfparse/gstivfparse.c index 35c0bd5..efc9825 100644 --- a/subprojects/gst-plugins-bad/gst/ivfparse/gstivfparse.c +++ b/subprojects/gst-plugins-bad/gst/ivfparse/gstivfparse.c @@ -225,8 +225,11 @@ gst_ivf_parse_update_src_caps (GstIvfParse * ivf) media_type = fourcc_to_media_type (ivf->fourcc); /* Create src pad caps */ - caps = gst_caps_new_simple (media_type, "width", G_TYPE_INT, ivf->width, - "height", G_TYPE_INT, ivf->height, NULL); + caps = gst_caps_new_empty_simple (media_type); + if (ivf->width > 0 && ivf->height > 0) { + gst_caps_set_simple (caps, "width", G_TYPE_INT, ivf->width, + "height", G_TYPE_INT, ivf->height, NULL); + } if (ivf->fps_n > 0 && ivf->fps_d > 0) { gst_base_parse_set_frame_rate (GST_BASE_PARSE_CAST (ivf), -- 2.7.4