[MPlayer-cvslog] r27548 - in trunk: libmpcodecs/ad_ffmpeg.c libmpcodecs/vd_ffmpeg.c libmpcodecs/ve_lavc.c libmpcodecs/vf_qp.c libmpdemux/demux_lavf.c

uau subversion at mplayerhq.hu
Mon Sep 8 19:02:32 CEST 2008


Author: uau
Date: Mon Sep  8 19:02:32 2008
New Revision: 27548

Log:
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().

Modified:
   trunk/libmpcodecs/ad_ffmpeg.c
   trunk/libmpcodecs/vd_ffmpeg.c
   trunk/libmpcodecs/ve_lavc.c
   trunk/libmpcodecs/vf_qp.c
   trunk/libmpdemux/demux_lavf.c

Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c	(original)
+++ trunk/libmpcodecs/ad_ffmpeg.c	Mon Sep  8 19:02:32 2008
@@ -63,7 +63,7 @@ static int init(sh_audio_t *sh_audio)
 	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

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	(original)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Mon Sep  8 19:02:32 2008
@@ -401,7 +401,7 @@ static int init(sh_video_t *sh){
 	}
 
     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);

Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c	(original)
+++ trunk/libmpcodecs/ve_lavc.c	Mon Sep  8 19:02:32 2008
@@ -240,7 +240,7 @@ m_option_t lavcopts_conf[]={
         {"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 @@ static int config(struct vf_instance_s* 
     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 @@ static int config(struct vf_instance_s* 
 #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 @@ static int config(struct vf_instance_s* 
 
 	  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 @@ static int config(struct vf_instance_s* 
     
     /* 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);

Modified: trunk/libmpcodecs/vf_qp.c
==============================================================================
--- trunk/libmpcodecs/vf_qp.c	(original)
+++ trunk/libmpcodecs/vf_qp.c	Mon Sep  8 19:02:32 2008
@@ -75,7 +75,10 @@ static int config(struct vf_instance_s* 
                 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);

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	(original)
+++ trunk/libmpdemux/demux_lavf.c	Mon Sep  8 19:02:32 2008
@@ -252,7 +252,7 @@ static void handle_stream(demuxer_t *dem
             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 @@ static void handle_stream(demuxer_t *dem
             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;



More information about the MPlayer-cvslog mailing list