diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2015-04-02 22:01:51 -0700 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2015-04-03 15:40:01 -0700 |
commit | 46b9df9f9e1eec5cdaa03ab842b34cf1f2ad9ece (patch) | |
tree | eae7a659723e84dc6382cc4a011aa1809342c97c /audio/format.h | |
parent | 07671ac57b41710201e9a0f22b8a8d0febad1c37 (diff) | |
download | mpv-46b9df9f9e1eec5cdaa03ab842b34cf1f2ad9ece.tar.bz2 mpv-46b9df9f9e1eec5cdaa03ab842b34cf1f2ad9ece.tar.xz |
audio: make all format query shortcuts macros
af_fmt_is_float and af_fmt_is_planar were previously inconsistent with
AF_FORAMT_IS_SPECIAL/AF_FORMAT_IS_IEC61937
Diffstat (limited to 'audio/format.h')
-rw-r--r-- | audio/format.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/format.h b/audio/format.h index 910b952fd2..5d41b2e3f1 100644 --- a/audio/format.h +++ b/audio/format.h @@ -96,6 +96,9 @@ enum af_format { #define AF_FORMAT_IS_IEC61937(f) (((f) & AF_FORMAT_TYPE_MASK) == AF_FORMAT_S) #define AF_FORMAT_IS_SPECIAL(f) AF_FORMAT_IS_IEC61937(f) +#define AF_FORMAT_IS_FLOAT(f) (!!((f) & AF_FORMAT_F)) +// false for interleaved and AF_FORMAT_UNKNOWN +#define AF_FORMAT_IS_PLANAR(f) (!!((f) & AF_FORMAT_PLANAR)) struct af_fmt_entry { const char *name; @@ -109,12 +112,10 @@ const char *af_fmt_to_str(int format); int af_fmt2bps(int format); int af_fmt2bits(int format); -bool af_fmt_is_float(int format); int af_fmt_change_bits(int format, int bits); int af_fmt_to_planar(int format); int af_fmt_from_planar(int format); -bool af_fmt_is_planar(int format); // Amount of bytes that contain audio of the given duration, aligned to frames. int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int samplerate); |