Commit 073bdc14 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

display: make zoom unsigned

The fraction is reduced, so the denominator cannot be negative.

As far as maths are concerned, a negative zoom means the image is
rotated 180 degrees. But we already have orientation to deal with that.
So forbid negative numerator too.
parent 153e954a
...@@ -94,8 +94,8 @@ typedef struct { ...@@ -94,8 +94,8 @@ typedef struct {
* It will be applied to the whole display if b_display_filled is set, otherwise * It will be applied to the whole display if b_display_filled is set, otherwise
* only on the video source */ * only on the video source */
struct { struct {
int num; unsigned num;
int den; unsigned den;
} zoom; } zoom;
vlc_viewpoint_t viewpoint; vlc_viewpoint_t viewpoint;
......
...@@ -1638,7 +1638,7 @@ static int ThreadReinit(vout_thread_t *vout, ...@@ -1638,7 +1638,7 @@ static int ThreadReinit(vout_thread_t *vout,
state.cfg.display.sar.num = 1; state.cfg.display.sar.num = 1;
state.cfg.display.sar.den = 1; state.cfg.display.sar.den = 1;
} }
if (state.cfg.zoom.num <= 0 || state.cfg.zoom.den <= 0) { if (state.cfg.zoom.num == 0 || state.cfg.zoom.den == 0) {
state.cfg.zoom.num = 1; state.cfg.zoom.num = 1;
state.cfg.zoom.den = 1; state.cfg.zoom.den = 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment