]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/swfdec.c
ffplay: get rid of void casts in the option table
[ffmpeg] / libavformat / swfdec.c
index 10a2ed733a309894b4ac2d75952d088dac915e2c..86ea6dec9e82e3545f55cea50e2b580f9b12a9b4 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;
@@ -164,7 +173,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) {
@@ -211,7 +220,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;
@@ -227,7 +236,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) {
@@ -236,7 +245,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;
             }
@@ -276,7 +285,7 @@ static av_cold int swf_read_close(AVFormatContext *avctx)
 
 AVInputFormat ff_swf_demuxer = {
     .name           = "swf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Flash format"),
+    .long_name      = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
     .priv_data_size = sizeof(SWFContext),
     .read_probe     = swf_probe,
     .read_header    = swf_read_header,