diff options.c @ 11560:8a4984c5cacc libavcodec

Define AVMediaType enum, and use it instead of enum CodecType, which is deprecated and will be dropped at the next major bump.
author stefano
date Tue, 30 Mar 2010 23:30:55 +0000
parents afe2ac7b175c
children 2baae9246958
line wrap: on
line diff
--- a/options.c	Tue Mar 30 22:09:14 2010 +0000
+++ b/options.c	Tue Mar 30 23:30:55 2010 +0000
@@ -423,18 +423,18 @@
 
 static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options };
 
-void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type){
+void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
     int flags=0;
     memset(s, 0, sizeof(AVCodecContext));
 
     s->av_class= &av_codec_context_class;
 
     s->codec_type = codec_type;
-    if(codec_type == CODEC_TYPE_AUDIO)
+    if(codec_type == AVMEDIA_TYPE_AUDIO)
         flags= AV_OPT_FLAG_AUDIO_PARAM;
-    else if(codec_type == CODEC_TYPE_VIDEO)
+    else if(codec_type == AVMEDIA_TYPE_VIDEO)
         flags= AV_OPT_FLAG_VIDEO_PARAM;
-    else if(codec_type == CODEC_TYPE_SUBTITLE)
+    else if(codec_type == AVMEDIA_TYPE_SUBTITLE)
         flags= AV_OPT_FLAG_SUBTITLE_PARAM;
     av_opt_set_defaults2(s, flags, flags);
 
@@ -453,7 +453,7 @@
     s->reordered_opaque= AV_NOPTS_VALUE;
 }
 
-AVCodecContext *avcodec_alloc_context2(enum CodecType codec_type){
+AVCodecContext *avcodec_alloc_context2(enum AVMediaType codec_type){
     AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
 
     if(avctx==NULL) return NULL;
@@ -464,10 +464,10 @@
 }
 
 void avcodec_get_context_defaults(AVCodecContext *s){
-    avcodec_get_context_defaults2(s, CODEC_TYPE_UNKNOWN);
+    avcodec_get_context_defaults2(s, AVMEDIA_TYPE_UNKNOWN);
 }
 
 AVCodecContext *avcodec_alloc_context(void){
-    return avcodec_alloc_context2(CODEC_TYPE_UNKNOWN);
+    return avcodec_alloc_context2(AVMEDIA_TYPE_UNKNOWN);
 }