This relies on the common initial seqence guarantee (and on C11 support for unnamed members).
Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> --- Alternatively, we could rely on type punning via unions and even use union { AVFrame *const f; ProgressFrame pf; }; libavcodec/progressframe.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; -- 2.40.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".