diff options
author | wm4 <wm4@nowhere> | 2013-10-26 15:05:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-26 15:05:59 +0200 |
commit | 7abc1bef40869d4efba88df8c5ad8b1ea4c49c57 (patch) | |
tree | ed1ef6c259c01dc119c4b99f84daefef5161bd93 /mpvcore | |
parent | 74e7043cc756e171ea1a7fd4be01019c14e1e265 (diff) | |
download | mpv-7abc1bef40869d4efba88df8c5ad8b1ea4c49c57.tar.bz2 mpv-7abc1bef40869d4efba88df8c5ad8b1ea4c49c57.tar.xz |
af: replace macros with too generic names
Defining names like min, max etc. in an often used header is not really
a good idea.
Somewhat similar to MPlayer svn commit 36491, but don't use libavutil,
because that typically causes us sorrow.
Diffstat (limited to 'mpvcore')
-rw-r--r-- | mpvcore/mp_common.h | 1 | ||||
-rw-r--r-- | mpvcore/mplayer.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/mpvcore/mp_common.h b/mpvcore/mp_common.h index 543c22073e..ecd84e33b6 100644 --- a/mpvcore/mp_common.h +++ b/mpvcore/mp_common.h @@ -36,6 +36,7 @@ #define MPMAX(a, b) ((a) > (b) ? (a) : (b)) #define MPMIN(a, b) ((a) > (b) ? (b) : (a)) +#define MPCLAMP(a, min, max) (((a) < (min)) ? (min) : (((a) > (max)) ? (max) : (a))) #define MPSWAP(type, a, b) \ do { type SWAP_tmp = b; b = a; a = SWAP_tmp; } while (0) #define MP_ARRAY_SIZE(s) (sizeof(s) / sizeof((s)[0])) diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index f076faf2b0..917f445556 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/mplayer.c @@ -3234,7 +3234,7 @@ double get_current_pos_ratio(struct MPContext *mpctx, bool use_range) } if (use_range) { if (mpctx->opts->play_frames > 0) - ans = max(ans, 1.0 - + ans = MPMAX(ans, 1.0 - mpctx->max_frames / (double) mpctx->opts->play_frames); } return ans; |