X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fcafdec.c;h=8b0daddd58eeb7040725ca502293d40c2343b0f7;hb=30bcd6a945ae296ef7b36a91cc21789a05de85d9;hp=b24ff1d02393d6f9c820681315eb4684ab762792;hpb=f211d9d8391c15e7408b8468dd7430eae2514544;p=ffmpeg diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index b24ff1d0239..8b0daddd58e 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -29,6 +29,7 @@ #include "riff.h" #include "isom.h" #include "libavutil/intreadwrite.h" +#include "libavutil/intfloat_readwrite.h" #include "libavutil/dict.h" #include "caf.h" @@ -67,7 +68,7 @@ static int read_desc_chunk(AVFormatContext *s) /* parse format description */ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->sample_rate = av_int2dbl(avio_rb64(pb)); - st->codec->codec_tag = avio_rb32(pb); + st->codec->codec_tag = avio_rl32(pb); flags = avio_rb32(pb); caf->bytes_per_packet = avio_rb32(pb); st->codec->block_align = caf->bytes_per_packet; @@ -84,7 +85,7 @@ static int read_desc_chunk(AVFormatContext *s) } /* determine codec */ - if (st->codec->codec_tag == MKBETAG('l','p','c','m')) + if (st->codec->codec_tag == MKTAG('l','p','c','m')) st->codec->codec_id = ff_mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample, (flags ^ 0x2) | 0x4); else st->codec->codec_id = ff_codec_get_id(ff_codec_caf_tags, st->codec->codec_tag); @@ -389,13 +390,12 @@ static int read_seek(AVFormatContext *s, int stream_index, } AVInputFormat ff_caf_demuxer = { - "caf", - NULL_IF_CONFIG_SMALL("Apple Core Audio Format"), - sizeof(CaffContext), - probe, - read_header, - read_packet, - NULL, - read_seek, + .name = "caf", + .long_name = NULL_IF_CONFIG_SMALL("Apple Core Audio Format"), + .priv_data_size = sizeof(CaffContext), + .read_probe = probe, + .read_header = read_header, + .read_packet = read_packet, + .read_seek = read_seek, .codec_tag = (const AVCodecTag*[]){ff_codec_caf_tags, 0}, };