[FFmpeg-devel] [PATCH 1/4] lavu: add av_x_if_null().

Clément Bœsch ubitux at gmail.com
Fri Sep 16 12:57:48 CEST 2011


---
 doc/APIchanges     |    3 +++
 libavutil/avutil.h |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index b97df1f..96d5453 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:   2011-04-18
 
 API changes, most recent first:
 
+2011-09-xx - xxxxxxx - lavu 51.17.0
+  Add av_x_if_null().
+
 2011-09-16 - xxxxxxx - lavfi 2.42.0
   Add avfilter_all_channel_layouts.
 
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index ef7a145..3d46365 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 51
-#define LIBAVUTIL_VERSION_MINOR 16
+#define LIBAVUTIL_VERSION_MINOR 17
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -135,6 +135,14 @@ enum AVPictureType {
  */
 char av_get_picture_type_char(enum AVPictureType pict_type);
 
+/**
+ * Return x default pointer in case p is NULL.
+ */
+static inline const void *av_x_if_null(const void *p, const void *x)
+{
+    return p ? p : x;
+}
+
 #include "common.h"
 #include "error.h"
 #include "mathematics.h"
-- 
1.7.6.1



More information about the ffmpeg-devel mailing list