dc1394src: minor clean-up

We always call _parse_caps() with non-NULL out vars.
This commit is contained in:
Tim-Philipp Müller 2016-06-09 22:01:45 +01:00
parent 09737d1874
commit faf6e5a1eb

View file

@ -1094,24 +1094,17 @@ gst_dc1394_src_parse_caps (const GstCaps * caps,
if (!structure) if (!structure)
goto error; goto error;
if (!width) { if (!gst_structure_get_int (structure, "width", &w)
} else if (!gst_structure_get_int (structure, "width", &w)) { || !gst_structure_get_int (structure, "height", &h))
goto error; goto error;
} else {
*width = w;
}
if (!height) { *width = w;
} else if (!gst_structure_get_int (structure, "height", &h)) { *height = h;
goto error;
} else {
*height = h;
}
if (!(rate || rate_decimal)) { if (!gst_structure_get_fraction (structure, "framerate", &num, &den))
} else if (!gst_structure_get_fraction (structure, "framerate", &num, &den)) {
goto error; 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; *rate = DC1394_FRAMERATE_1_875;
} else if (gst_util_fraction_compare (num, den, 240, 64) <= 0) { } else if (gst_util_fraction_compare (num, den, 240, 64) <= 0) {
*rate = DC1394_FRAMERATE_3_75; *rate = DC1394_FRAMERATE_3_75;
@ -1130,13 +1123,11 @@ gst_dc1394_src_parse_caps (const GstCaps * caps,
} else { } else {
*rate = DC1394_FRAMERATE_240; *rate = DC1394_FRAMERATE_240;
} }
if (rate_decimal) {
gst_util_fraction_to_double (num, den, &dec);
*rate_decimal = dec;
}
if (!color_codings) { gst_util_fraction_to_double (num, den, &dec);
} else if (gst_structure_has_name (structure, "video/x-raw")) { *rate_decimal = dec;
if (gst_structure_has_name (structure, "video/x-raw")) {
format = gst_structure_get_string (structure, "format"); format = gst_structure_get_string (structure, "format");
switch (gst_video_format_from_string (format)) { switch (gst_video_format_from_string (format)) {
case GST_VIDEO_FORMAT_GRAY8: case GST_VIDEO_FORMAT_GRAY8: