diff options
Diffstat (limited to 'sub/img_convert.c')
-rw-r--r-- | sub/img_convert.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sub/img_convert.c b/sub/img_convert.c index 0ce5c7ac0a..a70bb0a24c 100644 --- a/sub/img_convert.c +++ b/sub/img_convert.c @@ -17,9 +17,7 @@ #include <string.h> #include <assert.h> - -#include <libavutil/mem.h> -#include <libavutil/common.h> +#include <limits.h> #include "mpv_talloc.h" @@ -52,15 +50,15 @@ bool mp_sub_bitmaps_bb(struct sub_bitmaps *imgs, struct mp_rect *out_bb) struct mp_rect bb = {INT_MAX, INT_MAX, INT_MIN, INT_MIN}; for (int n = 0; n < imgs->num_parts; n++) { struct sub_bitmap *p = &imgs->parts[n]; - bb.x0 = FFMIN(bb.x0, p->x); - bb.y0 = FFMIN(bb.y0, p->y); - bb.x1 = FFMAX(bb.x1, p->x + p->dw); - bb.y1 = FFMAX(bb.y1, p->y + p->dh); + bb.x0 = MPMIN(bb.x0, p->x); + bb.y0 = MPMIN(bb.y0, p->y); + bb.x1 = MPMAX(bb.x1, p->x + p->dw); + bb.y1 = MPMAX(bb.y1, p->y + p->dh); } // avoid degenerate bounding box if empty - bb.x0 = FFMIN(bb.x0, bb.x1); - bb.y0 = FFMIN(bb.y0, bb.y1); + bb.x0 = MPMIN(bb.x0, bb.x1); + bb.y0 = MPMIN(bb.y0, bb.y1); *out_bb = bb; |