mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
ahcsrc: Avoid a div by 0 warning
https://bugzilla.gnome.org/show_bug.cgi?id=767302
This commit is contained in:
parent
1ee15d1385
commit
26b66a1db5
1 changed files with 5 additions and 1 deletions
|
@ -1946,7 +1946,7 @@ gst_ahc_src_setcaps (GstBaseSrc * src, GstCaps * caps)
|
|||
}
|
||||
}
|
||||
gst_ahc_parameters_supported_preview_fps_range_free (ranges);
|
||||
if (self->fps_max == 0) {
|
||||
if (self->fps_max == 0 || self->fps_min == 0) {
|
||||
GST_ERROR_OBJECT (self, "Couldn't find an applicable FPS range");
|
||||
goto end;
|
||||
}
|
||||
|
@ -2345,6 +2345,10 @@ gst_ahc_src_query (GstBaseSrc * bsrc, GstQuery * query)
|
|||
case GST_QUERY_LATENCY:{
|
||||
GstClockTime min;
|
||||
|
||||
/* Cannot query latency before setcaps() */
|
||||
if (self->fps_min == 0)
|
||||
return FALSE;
|
||||
|
||||
/* Allow of 1 frame latency base on the longer frame duration */
|
||||
gst_query_parse_latency (query, NULL, &min, NULL);
|
||||
min = gst_util_uint64_scale (GST_SECOND, 1000, self->fps_min);
|
||||
|
|
Loading…
Reference in a new issue