Skip to content

Commit a6bcc77

Browse files
committed
avcodec/ffv1enc: Fix explicitly set -slicecrc 2
crcref needs to be set properly iff ec is two, regardless of whether it has been explicitly set by the user or set by default based on level/version. Reviewed-by: Michael Niedermayer <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent 3cbe341 commit a6bcc77

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libavcodec/ffv1enc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ av_cold int ff_ffv1_encode_init(AVCodecContext *avctx)
629629
if (s->ec < 0) {
630630
if (s->version >= 4) {
631631
s->ec = 2;
632-
s->crcref = 0x7a8c4079;
633632
} else if (s->version >= 3) {
634633
s->ec = 1;
635634
} else
@@ -639,8 +638,10 @@ av_cold int ff_ffv1_encode_init(AVCodecContext *avctx)
639638
// CRC requires version 3+
640639
if (s->ec == 1)
641640
s->version = FFMAX(s->version, 3);
642-
if (s->ec == 2)
641+
if (s->ec == 2) {
643642
s->version = FFMAX(s->version, 4);
643+
s->crcref = 0x7a8c4079;
644+
}
644645

645646
if ((s->version == 2 || s->version>3) && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
646647
av_log(avctx, AV_LOG_ERROR, "Version 2 or 4 needed for requested features but version 2 or 4 is experimental and not enabled\n");

0 commit comments

Comments
 (0)