mirror of https://github.com/mpv-player/mpv
sub: assert potential pitfall
This one got me debugging for quite a while. Assert it for the future.
This commit is contained in:
parent
c704824b45
commit
872015813c
|
@ -506,8 +506,10 @@ void osd_rescale_bitmaps(struct sub_bitmaps *imgs, int frame_w, int frame_h,
|
||||||
int vidh = res.h - res.mt - res.mb;
|
int vidh = res.h - res.mt - res.mb;
|
||||||
double xscale = (double)vidw / frame_w;
|
double xscale = (double)vidw / frame_w;
|
||||||
double yscale = (double)vidh / frame_h;
|
double yscale = (double)vidh / frame_h;
|
||||||
if (compensate_par < 0)
|
if (compensate_par < 0) {
|
||||||
|
assert(res.display_par);
|
||||||
compensate_par = xscale / yscale / res.display_par;
|
compensate_par = xscale / yscale / res.display_par;
|
||||||
|
}
|
||||||
if (compensate_par > 0)
|
if (compensate_par > 0)
|
||||||
xscale /= compensate_par;
|
xscale /= compensate_par;
|
||||||
int cx = vidw / 2 - (int)(frame_w * xscale) / 2;
|
int cx = vidw / 2 - (int)(frame_w * xscale) / 2;
|
||||||
|
|
Loading…
Reference in New Issue