]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/swfdec.c
tools: do not use av_pix_fmt_descriptors directly.
[ffmpeg] / libavformat / swfdec.c
index e6036c60bc8c0663222e0c5fc7e6582fa0fe15a6..ff44452f8f02cbcab2701da91eebb45cffbd5f7f 100644 (file)
 #include "libavutil/intreadwrite.h"
 #include "swf.h"
 
+static const AVCodecTag swf_audio_codec_tags[] = {
+    { AV_CODEC_ID_PCM_S16LE,  0x00 },
+    { AV_CODEC_ID_ADPCM_SWF,  0x01 },
+    { AV_CODEC_ID_MP3,        0x02 },
+    { AV_CODEC_ID_PCM_S16LE,  0x03 },
+//  { AV_CODEC_ID_NELLYMOSER, 0x06 },
+    { AV_CODEC_ID_NONE,          0 },
+};
+
 static int get_swf_tag(AVIOContext *pb, int *len_ptr)
 {
     int tag, len;
@@ -36,7 +45,6 @@ static int get_swf_tag(AVIOContext *pb, int *len_ptr)
     if (len == 0x3f) {
         len = avio_rl32(pb);
     }
-//    av_log(NULL, AV_LOG_DEBUG, "Tag: %d - Len: %d\n", tag, len);
     *len_ptr = len;
     return tag;
 }
@@ -111,7 +119,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
                 return -1;
             vst->id = ch_id;
             vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            vst->codec->codec_id = ff_codec_get_id(swf_codec_tags, avio_r8(pb));
+            vst->codec->codec_id = ff_codec_get_id(ff_swf_codec_tags, avio_r8(pb));
             avpriv_set_pts_info(vst, 16, 256, swf->frame_rate);
             len -= 8;
         } else if (tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2) {
@@ -158,7 +166,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
             for (i = 0; i < s->nb_streams; i++) {
                 st = s->streams[i];
                 if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) {
-            if (st->codec->codec_id == CODEC_ID_MP3) {
+            if (st->codec->codec_id == AV_CODEC_ID_MP3) {
                 avio_skip(pb, 4);
                 if ((res = av_get_packet(pb, pkt, len-4)) < 0)
                     return res;
@@ -174,7 +182,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
         } else if (tag == TAG_JPEG2) {
             for (i=0; i<s->nb_streams; i++) {
                 st = s->streams[i];
-                if (st->codec->codec_id == CODEC_ID_MJPEG && st->id == -2)
+                if (st->codec->codec_id == AV_CODEC_ID_MJPEG && st->id == -2)
                     break;
             }
             if (i == s->nb_streams) {
@@ -183,7 +191,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
                     return -1;
                 vst->id = -2; /* -2 to avoid clash with video stream and audio stream */
                 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-                vst->codec->codec_id = CODEC_ID_MJPEG;
+                vst->codec->codec_id = AV_CODEC_ID_MJPEG;
                 avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
                 st = vst;
             }