[FFmpeg-cvslog] lavu/internal: add FF_FIELD_AT().

Nicolas George git at videolan.org
Sat Aug 14 11:11:42 EEST 2021


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Sat Jul 24 17:06:31 2021 +0200| [1d8e1afc009f2a916f672fc57f4971504bb13fb3] | committer: Nicolas George

lavu/internal: add FF_FIELD_AT().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d8e1afc009f2a916f672fc57f4971504bb13fb3
---

 libavutil/internal.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavutil/internal.h b/libavutil/internal.h
index 73498dc70d..b032e7540a 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -99,6 +99,11 @@
 
 #define FF_PTR_ADD(ptr, off) ((off) ? (ptr) + (off) : (ptr))
 
+/**
+ * Access a field in a structure by its offset.
+ */
+#define FF_FIELD_AT(type, off, obj) (*(type *)((char *)&(obj) + (off)))
+
 #include "libm.h"
 
 /**



More information about the ffmpeg-cvslog mailing list