#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;
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) {
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;
} 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) {
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;
}