diff --git a/libavdevice/alsa-audio.h b/libavdevice/alsa-audio.h index a90d5e780a9688a0b372c5072ecfb65b825b8950..949383157efc820fe7030f95731a3379c2060e3e 100644 --- a/libavdevice/alsa-audio.h +++ b/libavdevice/alsa-audio.h @@ -37,11 +37,7 @@ /* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: find better solution with "preinit" method, needed also in other formats */ -#if HAVE_BIGENDIAN -#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16BE -#else -#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16LE -#endif +#define DEFAULT_CODEC_ID AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE) typedef struct { snd_pcm_t *h; diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index d382c0376eea4c5c32afdf9595b9198841428d9b..9d007108e606f06ac64498ee7f3468d05cf351d0 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -315,11 +315,7 @@ AVOutputFormat oss_muxer = { /* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: find better solution with "preinit" method, needed also in other formats */ -#if HAVE_BIGENDIAN - CODEC_ID_PCM_S16BE, -#else - CODEC_ID_PCM_S16LE, -#endif + AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE), CODEC_ID_NONE, audio_write_header, audio_write_packet, diff --git a/libavutil/avutil.h b/libavutil/avutil.h index 50b29fc4a73e7143c4c38823fa0089c1c524e7c4..fdba9dee970c87d796b82650ec6318b059a7d97a 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -40,7 +40,7 @@ #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) #define LIBAVUTIL_VERSION_MAJOR 50 -#define LIBAVUTIL_VERSION_MINOR 23 +#define LIBAVUTIL_VERSION_MINOR 24 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/libavutil/common.h b/libavutil/common.h index f9c03db559aa851defb280e8e1a8e21e8282c8bd..e1b14dcc5373d51f0ed07f7f4037f1b1a7f8dd8a 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -35,6 +35,13 @@ #include <stdlib.h> #include <string.h> #include "attributes.h" +#include "avconfig.h" + +#if AV_HAVE_BIGENDIAN +# define AV_NE(be, le) be +#else +# define AV_NE(be, le) le +#endif //rounded division & shift #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))