A lot of codecs require aligned frame data, but do not document it. It can result in crashes with perfectly valid uses of the API.
TODO Implementation missing. Design rationale: - requiring frame data to be always aligned would be wasteful; - alignment requirements will evolve (the 16->32 bump is still recent); - requiring applications to worry about alignment is not convenient. Signed-off-by: Nicolas George <geo...@nsup.org> --- libavcodec/avcodec.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 35df4f6ced..51a7e2db21 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3644,6 +3644,16 @@ typedef struct AVCodecContext { * AVCodecContext.get_format callback) */ int hwaccel_flags; + + /** + * Minimum alignment of frame data required by the codec. + * All frame data pointers must have the alignment lower bits cleared, + * i.e. be a multiple of 1<<alignment. + * - encoding: set by the encoder and used by the framework + * - decoding: unused + */ + unsigned alignment; + } AVCodecContext; AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); -- 2.11.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel