changeset 32768:3544ba7244bf

Change deprecated PKT_FLAG_KEY, CODEC_TYPE_* and SAMPLE_FMT_* to their new names.
author reimar
date Sat, 05 Feb 2011 14:02:49 +0000
parents 414aaa8b9357
children 833b0eb23585
files 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
diffstat 7 files changed, 29 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/gui/bitmap.c	Sat Feb 05 13:58:36 2011 +0000
+++ b/gui/bitmap.c	Sat Feb 05 14:02:49 2011 +0000
@@ -62,7 +62,7 @@
  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) {
--- a/libmpcodecs/ad_ffmpeg.c	Sat Feb 05 13:58:36 2011 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Sat Feb 05 14:02:49 2011 +0000
@@ -59,10 +59,10 @@
     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 @@
     }
     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 @@
       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;
--- a/libmpcodecs/ae_lavc.c	Sat Feb 05 13:58:36 2011 +0000
+++ b/libmpcodecs/ae_lavc.c	Sat Feb 05 14:02:49 2011 +0000
@@ -184,7 +184,7 @@
 		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;
--- a/libmpcodecs/vd_ffmpeg.c	Sat Feb 05 13:58:36 2011 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sat Feb 05 14:02:49 2011 +0000
@@ -198,10 +198,10 @@
         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 @@
     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 @@
     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;
--- a/libmpcodecs/ve_lavc.c	Sat Feb 05 13:58:36 2011 +0000
+++ b/libmpcodecs/ve_lavc.c	Sat Feb 05 14:02:49 2011 +0000
@@ -1038,7 +1038,7 @@
 
     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;
--- a/libmpdemux/demux_lavf.c	Sat Feb 05 13:58:36 2011 +0000
+++ b/libmpdemux/demux_lavf.c	Sat Feb 05 14:02:49 2011 +0000
@@ -270,7 +270,7 @@
         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 @@
             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 @@
             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 @@
             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 @@
     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 @@
             {
                 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;
--- a/libmpdemux/muxer_lavf.c	Sat Feb 05 13:58:36 2011 +0000
+++ b/libmpdemux/muxer_lavf.c	Sat Feb 05 14:02:49 2011 +0000
@@ -159,10 +159,10 @@
 	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 @@
 	pkt.data = stream->buffer;
 
 	if(flags & AVIIF_KEYFRAME)
-		pkt.flags |= PKT_FLAG_KEY;
+		pkt.flags |= AV_PKT_FLAG_KEY;
 	else
 		pkt.flags = 0;