mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 06:15:43 +01:00
speaker-test: move existing endian macros up in the file
This is necessary for a later patch removing the various endianness checks sprinkled throughout the code. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
This commit is contained in:
parent
21d3717c3f
commit
8b0db35f63
1 changed files with 10 additions and 10 deletions
|
@ -68,6 +68,16 @@ enum {
|
||||||
|
|
||||||
#define MAX_CHANNELS 16
|
#define MAX_CHANNELS 16
|
||||||
|
|
||||||
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
#define COMPOSE_ID(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
|
||||||
|
#define LE_SHORT(v) (v)
|
||||||
|
#define LE_INT(v) (v)
|
||||||
|
#else
|
||||||
|
#define COMPOSE_ID(a,b,c,d) ((d) | ((c)<<8) | ((b)<<16) | ((a)<<24))
|
||||||
|
#define LE_SHORT(v) bswap_16(v)
|
||||||
|
#define LE_INT(v) bswap_32(v)
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *device = "default"; /* playback device */
|
static char *device = "default"; /* playback device */
|
||||||
static snd_pcm_format_t format = SND_PCM_FORMAT_S16; /* sample format */
|
static snd_pcm_format_t format = SND_PCM_FORMAT_S16; /* sample format */
|
||||||
static unsigned int rate = 48000; /* stream rate */
|
static unsigned int rate = 48000; /* stream rate */
|
||||||
|
@ -520,16 +530,6 @@ struct wave_header {
|
||||||
} chunk;
|
} chunk;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
||||||
#define COMPOSE_ID(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
|
|
||||||
#define LE_SHORT(v) (v)
|
|
||||||
#define LE_INT(v) (v)
|
|
||||||
#else
|
|
||||||
#define COMPOSE_ID(a,b,c,d) ((d) | ((c)<<8) | ((b)<<16) | ((a)<<24))
|
|
||||||
#define LE_SHORT(v) bswap_16(v)
|
|
||||||
#define LE_INT(v) bswap_32(v)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WAV_RIFF COMPOSE_ID('R','I','F','F')
|
#define WAV_RIFF COMPOSE_ID('R','I','F','F')
|
||||||
#define WAV_WAVE COMPOSE_ID('W','A','V','E')
|
#define WAV_WAVE COMPOSE_ID('W','A','V','E')
|
||||||
#define WAV_FMT COMPOSE_ID('f','m','t',' ')
|
#define WAV_FMT COMPOSE_ID('f','m','t',' ')
|
||||||
|
|
Loading…
Reference in a new issue