[MPlayer-cvslog] r34021 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Sat Aug 27 12:57:48 CEST 2011


Author: reimar
Date: Sat Aug 27 12:57:48 2011
New Revision: 34021

Log:
Replace several deprecated functions.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Sat Aug 27 12:52:30 2011	(r34020)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sat Aug 27 12:57:48 2011	(r34021)
@@ -240,11 +240,9 @@ static int init(sh_video_t *sh){
     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 @@ static int init(sh_video_t *sh){
         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;


More information about the MPlayer-cvslog mailing list