diff rmenc.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 7875964b4a58
children 11bb10c37225
line wrap: on
line diff
--- a/rmenc.c	Tue Mar 30 15:50:57 2010 +0000
+++ b/rmenc.c	Tue Mar 30 23:30:55 2010 +0000
@@ -141,7 +141,7 @@
 
         stream = &rm->streams[i];
 
-        if (stream->enc->codec_type == CODEC_TYPE_AUDIO) {
+        if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
             desc = "The Audio Stream";
             mimetype = "audio/x-pn-realaudio";
             codec_data_size = 73;
@@ -177,7 +177,7 @@
         put_str8(s, mimetype);
         put_be32(s, codec_data_size);
 
-        if (stream->enc->codec_type == CODEC_TYPE_AUDIO) {
+        if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
             int coded_frame_size, fscode, sample_rate;
             sample_rate = stream->enc->sample_rate;
             coded_frame_size = (stream->enc->bit_rate *
@@ -309,7 +309,7 @@
         stream->enc = codec;
 
         switch(codec->codec_type) {
-        case CODEC_TYPE_AUDIO:
+        case AVMEDIA_TYPE_AUDIO:
             rm->audio_stream = stream;
             stream->frame_rate = (float)codec->sample_rate / (float)codec->frame_size;
             /* XXX: dummy values */
@@ -317,7 +317,7 @@
             stream->nb_packets = 0;
             stream->total_frames = stream->nb_packets;
             break;
-        case CODEC_TYPE_VIDEO:
+        case AVMEDIA_TYPE_VIDEO:
             rm->video_stream = stream;
             stream->frame_rate = (float)codec->time_base.den / (float)codec->time_base.num;
             /* XXX: dummy values */
@@ -408,7 +408,7 @@
 static int rm_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     if (s->streams[pkt->stream_index]->codec->codec_type ==
-        CODEC_TYPE_AUDIO)
+        AVMEDIA_TYPE_AUDIO)
         return rm_write_audio(s, pkt->data, pkt->size, pkt->flags);
     else
         return rm_write_video(s, pkt->data, pkt->size, pkt->flags);