Mercurial > mplayer.hg
changeset 27516:3364aef9a988
Fix compilation after libavcodec major version 52 changes
Some symbols were dropped or renamed, requiring corresponding changes
in MPlayer.
- Use AVCodecContext->bits_per_coded_sample instead of ->bits_per_sample.
- Use AVCodecContext->trellis instead of ->flags&CODEC_FLAG_TRELLIS_QUANT.
- Don't set AVCodecContext->rtp_mode (already marked unused before).
- Use ff_eval2() instead of ff_eval().
author | uau |
---|---|
date | Mon, 08 Sep 2008 17:02:32 +0000 |
parents | 9355343a7721 |
children | af91c1e34603 |
files | libmpcodecs/ad_ffmpeg.c libmpcodecs/vd_ffmpeg.c libmpcodecs/ve_lavc.c libmpcodecs/vf_qp.c libmpdemux/demux_lavf.c |
diffstat | 5 files changed, 13 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c Mon Sep 08 12:36:38 2008 +0000 +++ b/libmpcodecs/ad_ffmpeg.c Mon Sep 08 17:02:32 2008 +0000 @@ -63,7 +63,7 @@ lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec; lavc_context->bit_rate = sh_audio->wf->nAvgBytesPerSec * 8; lavc_context->block_align = sh_audio->wf->nBlockAlign; - lavc_context->bits_per_sample = sh_audio->wf->wBitsPerSample; + lavc_context->bits_per_coded_sample = sh_audio->wf->wBitsPerSample; } lavc_context->request_channels = audio_output_channels; lavc_context->codec_tag = sh_audio->format; //FOURCC
--- a/libmpcodecs/vd_ffmpeg.c Mon Sep 08 12:36:38 2008 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Mon Sep 08 17:02:32 2008 +0000 @@ -401,7 +401,7 @@ } if(sh->bih) - avctx->bits_per_sample= sh->bih->biBitCount; + avctx->bits_per_coded_sample= sh->bih->biBitCount; if(lavc_param_threads > 1) avcodec_thread_init(avctx, lavc_param_threads);
--- a/libmpcodecs/ve_lavc.c Mon Sep 08 12:36:38 2008 +0000 +++ b/libmpcodecs/ve_lavc.c Mon Sep 08 17:02:32 2008 +0000 @@ -240,7 +240,7 @@ {"predia", &lavc_param_pre_dia_size, CONF_TYPE_INT, CONF_RANGE, -2000, 2000, NULL}, {"dia", &lavc_param_dia_size, CONF_TYPE_INT, CONF_RANGE, -2000, 2000, NULL}, {"qpel", &lavc_param_qpel, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL, NULL}, - {"trell", &lavc_param_trell, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT, NULL}, + {"trell", &lavc_param_trell, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"lowdelay", &lavc_param_lowdelay, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_LOW_DELAY, NULL}, {"last_pred", &lavc_param_last_pred, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, {"preme", &lavc_param_pre_me, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, @@ -369,7 +369,6 @@ lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold; lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold; lavc_venc_context->rtp_payload_size= lavc_param_packet_size; - if(lavc_param_packet_size )lavc_venc_context->rtp_mode=1; lavc_venc_context->strict_std_compliance= lavc_param_strict; lavc_venc_context->i_quant_factor= lavc_param_vi_qfactor; lavc_venc_context->i_quant_offset= (int)(FF_QP2LAMBDA * lavc_param_vi_qoffset + 0.5); @@ -540,7 +539,7 @@ #endif lavc_venc_context->dia_size= lavc_param_dia_size; lavc_venc_context->flags|= lavc_param_qpel; - lavc_venc_context->flags|= lavc_param_trell; + lavc_venc_context->trellis = lavc_param_trell; lavc_venc_context->flags|= lavc_param_lowdelay; lavc_venc_context->flags|= lavc_param_bit_exact; lavc_venc_context->flags|= lavc_param_aic; @@ -665,7 +664,7 @@ lavc_venc_context->flags &= ~CODEC_FLAG_QPEL; lavc_venc_context->flags &= ~CODEC_FLAG_4MV; - lavc_venc_context->flags &= ~CODEC_FLAG_TRELLIS_QUANT; + lavc_venc_context->trellis = 0; lavc_venc_context->flags &= ~CODEC_FLAG_CBP_RD; lavc_venc_context->flags &= ~CODEC_FLAG_QP_RD; lavc_venc_context->flags &= ~CODEC_FLAG_MV0; @@ -700,8 +699,8 @@ /* free second pass buffer, its not needed anymore */ av_freep(&lavc_venc_context->stats_in); - if(lavc_venc_context->bits_per_sample) - mux_v->bih->biBitCount= lavc_venc_context->bits_per_sample; + if(lavc_venc_context->bits_per_coded_sample) + mux_v->bih->biBitCount= lavc_venc_context->bits_per_coded_sample; if(lavc_venc_context->extradata_size){ mux_v->bih= realloc(mux_v->bih, sizeof(BITMAPINFOHEADER) + lavc_venc_context->extradata_size); memcpy(mux_v->bih + 1, lavc_venc_context->extradata, lavc_venc_context->extradata_size);
--- a/libmpcodecs/vf_qp.c Mon Sep 08 12:36:38 2008 +0000 +++ b/libmpcodecs/vf_qp.c Mon Sep 08 17:02:32 2008 +0000 @@ -75,7 +75,10 @@ NULL }; - vf->priv->lut[i+129]= lrintf(ff_eval(vf->priv->eq, const_values, const_names, NULL, NULL, NULL, NULL, NULL)); + const char *error = NULL; + vf->priv->lut[i+129]= lrintf(ff_eval2(vf->priv->eq, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error)); + if (error) + mp_msg(MSGT_VFILTER, MSGL_ERR, "qp: Error evaluating \"%s\": %s\n", vf->priv->eq, error); } return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
--- a/libmpdemux/demux_lavf.c Mon Sep 08 12:36:38 2008 +0000 +++ b/libmpdemux/demux_lavf.c Mon Sep 08 17:02:32 2008 +0000 @@ -252,7 +252,7 @@ wf->nSamplesPerSec= codec->sample_rate; wf->nAvgBytesPerSec= codec->bit_rate/8; wf->nBlockAlign= codec->block_align ? codec->block_align : 1; - wf->wBitsPerSample= codec->bits_per_sample; + wf->wBitsPerSample= codec->bits_per_coded_sample; wf->cbSize= codec->extradata_size; if(codec->extradata_size) memcpy(wf + 1, codec->extradata, codec->extradata_size); @@ -328,7 +328,7 @@ bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size; bih->biWidth= codec->width; bih->biHeight= codec->height; - bih->biBitCount= codec->bits_per_sample; + bih->biBitCount= codec->bits_per_coded_sample; bih->biSizeImage = bih->biWidth * bih->biHeight * bih->biBitCount/8; bih->biCompression= codec->codec_tag; sh_video->bih= bih;