# HG changeset patch # User reimar # Date 1314442668 0 # Node ID a5f1aaf217907e246430c0f0f3e751a35780a884 # Parent 11bdb6b598c01e79ce9559ae7d8593640209cf0e Replace several deprecated functions. diff -r 11bdb6b598c0 -r a5f1aaf21790 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Sat Aug 27 10:52:30 2011 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Sat Aug 27 10:57:48 2011 +0000 @@ -240,11 +240,9 @@ ctx->ip_count= ctx->b_count= 0; ctx->pic = avcodec_alloc_frame(); - ctx->avctx = avcodec_alloc_context(); + ctx->avctx = avcodec_alloc_context3(lavc_codec); avctx = ctx->avctx; - avcodec_get_context_defaults3(avctx, lavc_codec); avctx->opaque = sh; - avctx->codec_type = AVMEDIA_TYPE_VIDEO; avctx->codec_id = lavc_codec->id; avctx->get_format = get_format; @@ -390,7 +388,7 @@ set_format_params(avctx, PIX_FMT_XVMC_MPEG2_IDCT); /* open it */ - if (avcodec_open(avctx, lavc_codec) < 0) { + if (avcodec_open2(avctx, lavc_codec, NULL) < 0) { mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_CantOpenCodec); uninit(sh); return 0;