Skip to content

Commit

Permalink
display: make zoom unsigned
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Rémi Denis-Courmont committed May 20, 2018
1 parent 153e954 commit 073bdc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/vlc_vout_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ typedef struct {
* It will be applied to the whole display if b_display_filled is set, otherwise
* only on the video source */
struct {
int num;
int den;
unsigned num;
unsigned den;
} zoom;

vlc_viewpoint_t viewpoint;
Expand Down
2 changes: 1 addition & 1 deletion src/video_output/video_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ static int ThreadReinit(vout_thread_t *vout,
state.cfg.display.sar.num = 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.den = 1;
}
Expand Down

0 comments on commit 073bdc1

Please sign in to comment.