diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2016-06-09 22:01:45 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-06-09 22:01:45 +0100 |
commit | faf6e5a1eb757815d3e6ff49765e79b9895d4e48 (patch) | |
tree | ee3b0991a8aa711fc934b8a31733060a06483817 /ext/dc1394/gstdc1394src.c | |
parent | 09737d1874467558f51313fdf1d089edeccccdf8 (diff) | |
download | gstreamer-plugins-bad-faf6e5a1eb757815d3e6ff49765e79b9895d4e48.tar.gz |
dc1394src: minor clean-up
We always call _parse_caps() with non-NULL out vars.
Diffstat (limited to 'ext/dc1394/gstdc1394src.c')
-rw-r--r-- | ext/dc1394/gstdc1394src.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/ext/dc1394/gstdc1394src.c b/ext/dc1394/gstdc1394src.c index 3d73c58c2..c320ef2c7 100644 --- a/ext/dc1394/gstdc1394src.c +++ b/ext/dc1394/gstdc1394src.c @@ -1094,24 +1094,17 @@ gst_dc1394_src_parse_caps (const GstCaps * caps, if (!structure) goto error; - if (!width) { - } else if (!gst_structure_get_int (structure, "width", &w)) { + if (!gst_structure_get_int (structure, "width", &w) + || !gst_structure_get_int (structure, "height", &h)) goto error; - } else { - *width = w; - } - if (!height) { - } else if (!gst_structure_get_int (structure, "height", &h)) { - goto error; - } else { - *height = h; - } + *width = w; + *height = h; - if (!(rate || rate_decimal)) { - } else if (!gst_structure_get_fraction (structure, "framerate", &num, &den)) { + if (!gst_structure_get_fraction (structure, "framerate", &num, &den)) goto error; - } else if (gst_util_fraction_compare (num, den, 240, 128) <= 0) { + + if (gst_util_fraction_compare (num, den, 240, 128) <= 0) { *rate = DC1394_FRAMERATE_1_875; } else if (gst_util_fraction_compare (num, den, 240, 64) <= 0) { *rate = DC1394_FRAMERATE_3_75; @@ -1130,13 +1123,11 @@ gst_dc1394_src_parse_caps (const GstCaps * caps, } else { *rate = DC1394_FRAMERATE_240; } - if (rate_decimal) { - gst_util_fraction_to_double (num, den, &dec); - *rate_decimal = dec; - } - if (!color_codings) { - } else if (gst_structure_has_name (structure, "video/x-raw")) { + gst_util_fraction_to_double (num, den, &dec); + *rate_decimal = dec; + + if (gst_structure_has_name (structure, "video/x-raw")) { format = gst_structure_get_string (structure, "format"); switch (gst_video_format_from_string (format)) { case GST_VIDEO_FORMAT_GRAY8: |