diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-07-10 14:29:10 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-07-10 14:32:55 +0200 |
commit | acf0283925151bdfa135e934cf6e3c351b2adf75 (patch) | |
tree | 9360d44cd5a1855fb95209ecbcd7cc32af022d71 | |
parent | 4c4e125695909caa7ab3ebce5c34463b7a10bfc6 (diff) | |
download | ffmpeg-acf0283925151bdfa135e934cf6e3c351b2adf75.tar.gz |
Set default ffv1 coder to -1.
Autoselect coder 1 instead of default coder if bits_per_raw_sample > 8.
Fixes ticket #1519.
-rw-r--r-- | libavcodec/ffv1.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index a0322dfa3f..6d60117d2e 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -916,7 +916,7 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - s->ac= avctx->coder_type ? 2:0; + s->ac= avctx->coder_type > 0 ? 2 : 0; s->plane_count=3; switch(avctx->pix_fmt){ @@ -944,6 +944,10 @@ static av_cold int encode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n"); return AVERROR_INVALIDDATA; } + if(!s->ac && avctx->coder_type == -1) { + av_log(avctx, AV_LOG_INFO, "bits_per_raw_sample > 8, forcing coder 1\n"); + s->ac = 2; + } if(!s->ac){ av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample of more than 8 needs -coder 1 currently\n"); return AVERROR_INVALIDDATA; @@ -2058,6 +2062,11 @@ static const AVClass class = { .version = LIBAVUTIL_VERSION_INT, }; +static const AVCodecDefault ffv1_defaults[] = { + { "coder", "-1" }, + { NULL }, +}; + AVCodec ff_ffv1_encoder = { .name = "ffv1", .type = AVMEDIA_TYPE_VIDEO, @@ -2067,6 +2076,7 @@ AVCodec ff_ffv1_encoder = { .encode2 = encode_frame, .close = common_end, .capabilities = CODEC_CAP_SLICE_THREADS, + .defaults = ffv1_defaults, .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_YUVA420P, PIX_FMT_YUVA422P, PIX_FMT_YUV444P, PIX_FMT_YUVA444P, PIX_FMT_YUV440P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, |