The crc flag is only stored since version 3 thus before this crcs do not
work. We increase the version as needed same as we do with pix_fmts
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d9706f79c17a33bf97e51a7d6ab211ce83a463ee)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -539,6 +539,10 @@ static av_cold int encode_init(AVCodecContext *avctx) |
539 | 539 |
s->ec = (s->version >= 3); |
540 | 540 |
} |
541 | 541 |
|
542 |
+ // CRC requires version 3+ |
|
543 |
+ if (s->ec) |
|
544 |
+ s->version = FFMAX(s->version, 3); |
|
545 |
+ |
|
542 | 546 |
if ((s->version == 2 || s->version>3) && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { |
543 | 547 |
av_log(avctx, AV_LOG_ERROR, "Version 2 needed for requested features but version 2 is experimental and not enabled\n"); |
544 | 548 |
return AVERROR_INVALIDDATA; |