image_writer: take care of prediction_method deprecation

The field was recently deprecated, and you're supposed to set the
private codec option instead.

Not sure if this really works as intended.
This commit is contained in:
wm4 2016-02-09 13:24:04 +01:00
parent 5ca35aafdb
commit 3d09bd77dd
1 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,7 @@
#include <libavcodec/avcodec.h>
#include <libavutil/mem.h>
#include <libavutil/opt.h>
#include "config.h"
@ -111,7 +112,8 @@ static bool write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp
}
if (ctx->writer->lavc_codec == AV_CODEC_ID_PNG) {
avctx->compression_level = ctx->opts->png_compression;
avctx->prediction_method = ctx->opts->png_filter;
av_opt_set_int(avctx, "pred", ctx->opts->png_filter,
AV_OPT_SEARCH_CHILDREN);
}
if (avcodec_open2(avctx, codec, NULL) < 0) {