X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fswfdec.c;h=ff44452f8f02cbcab2701da91eebb45cffbd5f7f;hb=b7f1010c8fce09096057528f7cd29589ea1ae7df;hp=e6036c60bc8c0663222e0c5fc7e6582fa0fe15a6;hpb=0177b7d23aadeab218601893953f0a05209d037c;p=ffmpeg diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index e6036c60bc8..ff44452f8f0 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -23,6 +23,15 @@ #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; inb_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; }