[FFmpeg-cvslog] r24814 - in trunk: libavdevice/alsa-audio.h libavdevice/oss_audio.c libavutil/avutil.h libavutil/common.h

stefano subversion
Tue Aug 17 20:25:34 CEST 2010


Author: stefano
Date: Tue Aug 17 20:25:34 2010
New Revision: 24814

Log:
Define macro AV_NE() and use it in libavdevice.

Help further refactoring.

Modified:
   trunk/libavdevice/alsa-audio.h
   trunk/libavdevice/oss_audio.c
   trunk/libavutil/avutil.h
   trunk/libavutil/common.h

Modified: trunk/libavdevice/alsa-audio.h
==============================================================================
--- trunk/libavdevice/alsa-audio.h	Tue Aug 17 20:13:14 2010	(r24813)
+++ trunk/libavdevice/alsa-audio.h	Tue Aug 17 20:25:34 2010	(r24814)
@@ -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;

Modified: trunk/libavdevice/oss_audio.c
==============================================================================
--- trunk/libavdevice/oss_audio.c	Tue Aug 17 20:13:14 2010	(r24813)
+++ trunk/libavdevice/oss_audio.c	Tue Aug 17 20:25:34 2010	(r24814)
@@ -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,

Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h	Tue Aug 17 20:13:14 2010	(r24813)
+++ trunk/libavutil/avutil.h	Tue Aug 17 20:25:34 2010	(r24814)
@@ -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, \

Modified: trunk/libavutil/common.h
==============================================================================
--- trunk/libavutil/common.h	Tue Aug 17 20:13:14 2010	(r24813)
+++ trunk/libavutil/common.h	Tue Aug 17 20:25:34 2010	(r24814)
@@ -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))



More information about the ffmpeg-cvslog mailing list