[MPlayer-cvslog] r32855 - in trunk: gui/bitmap.c libmpcodecs/ad_ffmpeg.c libmpcodecs/ae_lavc.c libmpcodecs/vd_ffmpeg.c libmpcodecs/ve_lavc.c libmpdemux/demux_lavf.c libmpdemux/muxer_lavf.c

reimar subversion at mplayerhq.hu
Sat Feb 5 15:02:49 CET 2011


Author: reimar
Date: Sat Feb  5 15:02:49 2011
New Revision: 32855

Log:
Change deprecated PKT_FLAG_KEY, CODEC_TYPE_* and SAMPLE_FMT_* to their
new names.

Modified:
   trunk/gui/bitmap.c
   trunk/libmpcodecs/ad_ffmpeg.c
   trunk/libmpcodecs/ae_lavc.c
   trunk/libmpcodecs/vd_ffmpeg.c
   trunk/libmpcodecs/ve_lavc.c
   trunk/libmpdemux/demux_lavf.c
   trunk/libmpdemux/muxer_lavf.c

Modified: trunk/gui/bitmap.c
==============================================================================
--- trunk/gui/bitmap.c	Sat Feb  5 14:58:36 2011	(r32854)
+++ trunk/gui/bitmap.c	Sat Feb  5 15:02:49 2011	(r32855)
@@ -62,7 +62,7 @@ static int pngRead( unsigned char * fnam
  pkt.data = data;
  pkt.size = len;
  // HACK: make PNGs decode normally instead of as CorePNG delta frames
- pkt.flags = PKT_FLAG_KEY;
+ pkt.flags = AV_PKT_FLAG_KEY;
  avcodec_decode_video2(avctx, frame, &decode_ok, &pkt);
  memset(bf, 0, sizeof(*bf));
  switch (avctx->pix_fmt) {

Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c	Sat Feb  5 14:58:36 2011	(r32854)
+++ trunk/libmpcodecs/ad_ffmpeg.c	Sat Feb  5 15:02:49 2011	(r32855)
@@ -59,10 +59,10 @@ static int setup_format(sh_audio_t *sh_a
     int samplerate    = lavc_context->sample_rate;
     int sample_format = sh_audio->sample_format;
     switch (lavc_context->sample_fmt) {
-        case SAMPLE_FMT_U8:  sample_format = AF_FORMAT_U8;       break;
-        case SAMPLE_FMT_S16: sample_format = AF_FORMAT_S16_NE;   break;
-        case SAMPLE_FMT_S32: sample_format = AF_FORMAT_S32_NE;   break;
-        case SAMPLE_FMT_FLT: sample_format = AF_FORMAT_FLOAT_NE; break;
+        case AV_SAMPLE_FMT_U8:  sample_format = AF_FORMAT_U8;       break;
+        case AV_SAMPLE_FMT_S16: sample_format = AF_FORMAT_S16_NE;   break;
+        case AV_SAMPLE_FMT_S32: sample_format = AF_FORMAT_S32_NE;   break;
+        case AV_SAMPLE_FMT_FLT: sample_format = AF_FORMAT_FLOAT_NE; break;
         default:
             mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Unsupported sample format\n");
     }
@@ -122,7 +122,7 @@ static int init(sh_audio_t *sh_audio)
     }
     lavc_context->request_channels = audio_output_channels;
     lavc_context->codec_tag = sh_audio->format; //FOURCC
-    lavc_context->codec_type = CODEC_TYPE_AUDIO;
+    lavc_context->codec_type = AVMEDIA_TYPE_AUDIO;
     lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi
 
     /* alloc extra data */
@@ -172,10 +172,10 @@ static int init(sh_audio_t *sh_audio)
       sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec;
 
   switch (lavc_context->sample_fmt) {
-      case SAMPLE_FMT_U8:
-      case SAMPLE_FMT_S16:
-      case SAMPLE_FMT_S32:
-      case SAMPLE_FMT_FLT:
+      case AV_SAMPLE_FMT_U8:
+      case AV_SAMPLE_FMT_S16:
+      case AV_SAMPLE_FMT_S32:
+      case AV_SAMPLE_FMT_FLT:
           break;
       default:
           return 0;

Modified: trunk/libmpcodecs/ae_lavc.c
==============================================================================
--- trunk/libmpcodecs/ae_lavc.c	Sat Feb  5 14:58:36 2011	(r32854)
+++ trunk/libmpcodecs/ae_lavc.c	Sat Feb  5 15:02:49 2011	(r32855)
@@ -184,7 +184,7 @@ int mpae_init_lavc(audio_encoder_t *enco
 		return 0;
 	}
 
-	lavc_actx->codec_type = CODEC_TYPE_AUDIO;
+	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;

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Sat Feb  5 14:58:36 2011	(r32854)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sat Feb  5 15:02:49 2011	(r32855)
@@ -198,10 +198,10 @@ static void mp_msp_av_log_callback(void 
         if(!strcmp(avc->class_name, "AVCodecContext")){
             AVCodecContext *s= ptr;
             if(s->codec){
-                if(s->codec->type == CODEC_TYPE_AUDIO){
+                if(s->codec->type == AVMEDIA_TYPE_AUDIO){
                     if(s->codec->decode)
                         type= MSGT_DECAUDIO;
-                }else if(s->codec->type == CODEC_TYPE_VIDEO){
+                }else if(s->codec->type == AVMEDIA_TYPE_VIDEO){
                     if(s->codec->decode)
                         type= MSGT_DECVIDEO;
                 }
@@ -292,7 +292,7 @@ static int init(sh_video_t *sh){
     ctx->avctx = avcodec_alloc_context();
     avctx = ctx->avctx;
     avctx->opaque = sh;
-    avctx->codec_type = CODEC_TYPE_VIDEO;
+    avctx->codec_type = AVMEDIA_TYPE_VIDEO;
     avctx->codec_id = lavc_codec->id;
 
 #if CONFIG_VDPAU
@@ -834,7 +834,7 @@ static mp_image_t *decode(sh_video_t *sh
     pkt.data = data;
     pkt.size = len;
     // HACK: make PNGs decode normally instead of as CorePNG delta frames
-    pkt.flags = PKT_FLAG_KEY;
+    pkt.flags = AV_PKT_FLAG_KEY;
     ret = avcodec_decode_video2(avctx, pic, &got_picture, &pkt);
 
     dr1= ctx->do_dr1;

Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c	Sat Feb  5 14:58:36 2011	(r32854)
+++ trunk/libmpcodecs/ve_lavc.c	Sat Feb  5 15:02:49 2011	(r32855)
@@ -1038,7 +1038,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 = CODEC_TYPE_VIDEO;
+    vf->priv->context->codec_type = AVMEDIA_TYPE_VIDEO;
     vf->priv->context->codec_id = vf->priv->codec->id;
 
     return 1;

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	Sat Feb  5 14:58:36 2011	(r32854)
+++ trunk/libmpdemux/demux_lavf.c	Sat Feb  5 15:02:49 2011	(r32855)
@@ -270,7 +270,7 @@ static void handle_stream(demuxer_t *dem
         codec->codec_tag = override_tag;
 
     switch(codec->codec_type){
-        case CODEC_TYPE_AUDIO:{
+        case AVMEDIA_TYPE_AUDIO:{
             WAVEFORMATEX *wf;
             sh_audio_t* sh_audio;
             sh_audio = new_sh_audio_aid(demuxer, i, priv->audio_streams, lang ? lang->value : NULL);
@@ -344,7 +344,7 @@ static void handle_stream(demuxer_t *dem
             stream_id = priv->audio_streams++;
             break;
         }
-        case CODEC_TYPE_VIDEO:{
+        case AVMEDIA_TYPE_VIDEO:{
             sh_video_t* sh_video;
             BITMAPINFOHEADER *bih;
             sh_video=new_sh_video_vid(demuxer, i, priv->video_streams);
@@ -416,7 +416,7 @@ static void handle_stream(demuxer_t *dem
             stream_id = priv->video_streams++;
             break;
         }
-        case CODEC_TYPE_SUBTITLE:{
+        case AVMEDIA_TYPE_SUBTITLE:{
             sh_sub_t* sh_sub;
             char type;
             /* only support text subtitles for now */
@@ -455,7 +455,7 @@ static void handle_stream(demuxer_t *dem
             stream_id = priv->sub_streams++;
             break;
         }
-        case CODEC_TYPE_ATTACHMENT:{
+        case AVMEDIA_TYPE_ATTACHMENT:{
             if (st->codec->codec_id == CODEC_ID_TTF)
                 demuxer_add_attachment(demuxer, st->filename,
                                        "application/x-truetype-font",
@@ -641,14 +641,14 @@ static int demux_lavf_fill_buffer(demuxe
     if(pkt.pts != AV_NOPTS_VALUE){
         dp->pts=pkt.pts * av_q2d(priv->avfc->streams[id]->time_base);
         priv->last_pts= dp->pts * AV_TIME_BASE;
-        // always set endpts for subtitles, even if PKT_FLAG_KEY is not set,
+        // always set endpts for subtitles, even if AV_PKT_FLAG_KEY is not set,
         // otherwise they will stay on screen to long if e.g. ASS is demuxed from mkv
-        if((ds == demux->sub || (pkt.flags & PKT_FLAG_KEY)) &&
+        if((ds == demux->sub || (pkt.flags & AV_PKT_FLAG_KEY)) &&
            pkt.convergence_duration > 0)
             dp->endpts = dp->pts + pkt.convergence_duration * av_q2d(priv->avfc->streams[id]->time_base);
     }
     dp->pos=demux->filepos;
-    dp->flags= !!(pkt.flags&PKT_FLAG_KEY);
+    dp->flags= !!(pkt.flags&AV_PKT_FLAG_KEY);
     // append packet to DS stream:
     ds_add_packet(ds,dp);
     return 1;
@@ -788,15 +788,15 @@ redo:
             {
                 switch(priv->avfc->streams[program->stream_index[i]]->codec->codec_type)
                 {
-                    case CODEC_TYPE_VIDEO:
+                    case AVMEDIA_TYPE_VIDEO:
                         if(prog->vid == -2)
                             prog->vid = program->stream_index[i];
                         break;
-                    case CODEC_TYPE_AUDIO:
+                    case AVMEDIA_TYPE_AUDIO:
                         if(prog->aid == -2)
                             prog->aid = program->stream_index[i];
                         break;
-                    case CODEC_TYPE_SUBTITLE:
+                    case AVMEDIA_TYPE_SUBTITLE:
                         if(prog->sid == -2 && priv->avfc->streams[program->stream_index[i]]->codec->codec_id == CODEC_ID_TEXT)
                             prog->sid = program->stream_index[i];
                         break;

Modified: trunk/libmpdemux/muxer_lavf.c
==============================================================================
--- trunk/libmpdemux/muxer_lavf.c	Sat Feb  5 14:58:36 2011	(r32854)
+++ trunk/libmpdemux/muxer_lavf.c	Sat Feb  5 15:02:49 2011	(r32855)
@@ -159,10 +159,10 @@ static muxer_stream_t* lavf_new_stream(m
 	switch(type)
 	{
 		case MUXER_TYPE_VIDEO:
-			ctx->codec_type = CODEC_TYPE_VIDEO;
+			ctx->codec_type = AVMEDIA_TYPE_VIDEO;
 			break;
 		case MUXER_TYPE_AUDIO:
-			ctx->codec_type = CODEC_TYPE_AUDIO;
+			ctx->codec_type = AVMEDIA_TYPE_AUDIO;
 			break;
 	}
 
@@ -260,7 +260,7 @@ static void write_chunk(muxer_stream_t *
 	pkt.data = stream->buffer;
 
 	if(flags & AVIIF_KEYFRAME)
-		pkt.flags |= PKT_FLAG_KEY;
+		pkt.flags |= AV_PKT_FLAG_KEY;
 	else
 		pkt.flags = 0;
 


More information about the MPlayer-cvslog mailing list