This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 27d95c3cf83250ec76fdfc36ce73ff95d106afe2 Author: Andreas Rheinhardt <[email protected]> AuthorDate: Sat Jun 28 04:56:18 2025 +0200 Commit: Andreas Rheinhardt <[email protected]> CommitDate: Sat Mar 7 20:14:36 2026 +0100 avcodec/mpegvideo_enc: Move dimension-alignment check to rv10enc.c Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/mpegvideo_enc.c | 7 ------- libavcodec/rv10enc.c | 12 +++++++++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index c0bae3f3e4..23ec03e71e 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -774,13 +774,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - if (s->c.codec_id == AV_CODEC_ID_RV10 && - (avctx->width &15 || - avctx->height&15 )) { - av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 16\n"); - return AVERROR(EINVAL); - } - if ((s->c.codec_id == AV_CODEC_ID_WMV1 || s->c.codec_id == AV_CODEC_ID_WMV2) && avctx->width & 1) { diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index 534b93fd81..3609d82161 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -66,6 +66,16 @@ int ff_rv10_encode_picture_header(MPVMainEncContext *const m) return 0; } +static av_cold int rv10_encode_init(AVCodecContext *avctx) +{ + if ((avctx->width | avctx->height) & 15) { + av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 16\n"); + return AVERROR(EINVAL); + } + + return ff_mpv_encode_init(avctx); +} + const FFCodec ff_rv10_encoder = { .p.name = "rv10", CODEC_LONG_NAME("RealVideo 1.0"), @@ -74,7 +84,7 @@ const FFCodec ff_rv10_encoder = { .p.priv_class = &ff_mpv_enc_class, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(MPVMainEncContext), - .init = ff_mpv_encode_init, + .init = rv10_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
