aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-19 14:59:29 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-21 16:31:42 +0200
commit1d17d84b7d564228629d78c1c510de467662c5bc (patch)
tree20efab1985542c5111ff1ec0ce49205c2054821b /libavcodec
parent822e2843ca1ce185ebff3b665e62f3fc56bbd22a (diff)
downloadffmpeg-1d17d84b7d564228629d78c1c510de467662c5bc.tar.gz
avcodec/progressframe: Explain how unnamed union can simplify accesses
This relies on the common initial seqence guarantee (and on C11 support for unnamed members). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/progressframe.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/progressframe.h b/libavcodec/progressframe.h
index dc841f30d2..428a461659 100644
--- a/libavcodec/progressframe.h
+++ b/libavcodec/progressframe.h
@@ -58,6 +58,18 @@
struct AVCodecContext;
+/**
+ * The ProgressFrame structure.
+ * Hint: It is guaranteed that the AVFrame pointer is at the start
+ * of ProgressFrame. This allows to use an unnamed
+ * union {
+ * struct {
+ * AVFrame *f;
+ * };
+ * ProgressFrame pf;
+ * };
+ * to simplify accessing the embedded AVFrame.
+ */
typedef struct ProgressFrame {
struct AVFrame *f;
struct ProgressInternal *progress;