[MPlayer-cvslog] r34023 - in trunk/libmpcodecs: ae_lavc.c ve_lavc.c
reimar
subversion at mplayerhq.hu
Sat Aug 27 13:04:53 CEST 2011
Author: reimar
Date: Sat Aug 27 13:04:53 2011
New Revision: 34023
Log:
Only use non-deprecated code in lavc encoders.
Modified:
trunk/libmpcodecs/ae_lavc.c
trunk/libmpcodecs/ve_lavc.c
Modified: trunk/libmpcodecs/ae_lavc.c
==============================================================================
--- trunk/libmpcodecs/ae_lavc.c Sat Aug 27 13:02:04 2011 (r34022)
+++ trunk/libmpcodecs/ae_lavc.c Sat Aug 27 13:04:53 2011 (r34023)
@@ -178,14 +178,13 @@ int mpae_init_lavc(audio_encoder_t *enco
}
}
- lavc_actx = avcodec_alloc_context();
+ lavc_actx = avcodec_alloc_context3(lavc_acodec);
if(lavc_actx == NULL)
{
mp_msg(MSGT_MENCODER, MSGL_FATAL, MSGTR_CouldntAllocateLavcContext);
return 0;
}
- lavc_actx->codec_type = AVMEDIA_TYPE_AUDIO;
lavc_actx->codec_id = lavc_acodec->id;
// put sample parameters
lavc_actx->sample_fmt = AV_SAMPLE_FMT_S16;
@@ -238,7 +237,7 @@ int mpae_init_lavc(audio_encoder_t *enco
lavc_actx->flags2 |= CODEC_FLAG2_LOCAL_HEADER;
}
- if(avcodec_open(lavc_actx, lavc_acodec) < 0)
+ if(avcodec_open2(lavc_actx, lavc_acodec, NULL) < 0)
{
mp_msg(MSGT_MENCODER, MSGL_FATAL, MSGTR_CouldntOpenCodec, lavc_param_acodec, lavc_param_abitrate);
return 0;
Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c Sat Aug 27 13:02:04 2011 (r34022)
+++ trunk/libmpcodecs/ve_lavc.c Sat Aug 27 13:04:53 2011 (r34023)
@@ -686,7 +686,7 @@ static int config(struct vf_instance *vf
lavc_venc_context->thread_count = lavc_param_threads;
lavc_venc_context->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE;
- if (avcodec_open(lavc_venc_context, vf->priv->codec) != 0) {
+ if (avcodec_open2(lavc_venc_context, vf->priv->codec, NULL) != 0) {
mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantOpenCodec);
return 0;
}
@@ -1037,8 +1037,7 @@ static int vf_open(vf_instance_t *vf, ch
}
vf->priv->pic = avcodec_alloc_frame();
- vf->priv->context = avcodec_alloc_context();
- vf->priv->context->codec_type = AVMEDIA_TYPE_VIDEO;
+ vf->priv->context = avcodec_alloc_context3(vf->priv->codec);
vf->priv->context->codec_id = vf->priv->codec->id;
return 1;
More information about the MPlayer-cvslog
mailing list