diff flvenc.c @ 5910:536e5527c1e0 libavformat

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 a427102c12cd
children 11bb10c37225
line wrap: on
line diff
--- a/flvenc.c	Tue Mar 30 15:50:57 2010 +0000
+++ b/flvenc.c	Tue Mar 30 23:30:55 2010 +0000
@@ -166,7 +166,7 @@
 
     for(i=0; i<s->nb_streams; i++){
         AVCodecContext *enc = s->streams[i]->codec;
-        if (enc->codec_type == CODEC_TYPE_VIDEO) {
+        if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
             if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) {
                 framerate = av_q2d(s->streams[i]->r_frame_rate);
             } else {
@@ -275,7 +275,7 @@
         AVCodecContext *enc = s->streams[i]->codec;
         if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) {
             int64_t pos;
-            put_byte(pb, enc->codec_type == CODEC_TYPE_VIDEO ?
+            put_byte(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ?
                      FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
             put_be24(pb, 0); // size patched later
             put_be24(pb, 0); // ts
@@ -342,7 +342,7 @@
     else
         flags_size= 1;
 
-    if (enc->codec_type == CODEC_TYPE_VIDEO) {
+    if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
         put_byte(pb, FLV_TAG_TYPE_VIDEO);
 
         flags = enc->codec_tag;
@@ -353,7 +353,7 @@
 
         flags |= pkt->flags & PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER;
     } else {
-        assert(enc->codec_type == CODEC_TYPE_AUDIO);
+        assert(enc->codec_type == AVMEDIA_TYPE_AUDIO);
         flags = get_audio_flags(enc);
 
         assert(size);