.. | .. |
---|
327 | 327 | * - Delta for CEIL: delta_from_mid_point_in_us_1 |
---|
328 | 328 | * - Delta for FLOOR: delta_from_mid_point_in_us_2 |
---|
329 | 329 | */ |
---|
330 | | - if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) { |
---|
| 330 | + if (mid_point_frames_ceil && |
---|
| 331 | + (last_render_time_in_us / mid_point_frames_ceil) < |
---|
| 332 | + in_out_vrr->min_duration_in_us) { |
---|
331 | 333 | /* Check for out of range. |
---|
332 | 334 | * If using CEIL produces a value that is out of range, |
---|
333 | 335 | * then we are forced to use FLOOR. |
---|
.. | .. |
---|
374 | 376 | /* Either we've calculated the number of frames to insert, |
---|
375 | 377 | * or we need to insert min duration frames |
---|
376 | 378 | */ |
---|
377 | | - if (last_render_time_in_us / frames_to_insert < |
---|
378 | | - in_out_vrr->min_duration_in_us){ |
---|
| 379 | + if (frames_to_insert && |
---|
| 380 | + (last_render_time_in_us / frames_to_insert) < |
---|
| 381 | + in_out_vrr->min_duration_in_us){ |
---|
379 | 382 | frames_to_insert -= (frames_to_insert > 1) ? |
---|
380 | 383 | 1 : 0; |
---|
381 | 384 | } |
---|