Revision e63a3628 libavformat/aiffdec.c

View differences:

libavformat/aiffdec.c
54 54
    if (url_feof(pb))
55 55
        return AVERROR(EIO);
56 56

  
57
    *tag = get_le32(pb);
58
    size = get_be32(pb);
57
    *tag = avio_rl32(pb);
58
    size = avio_rb32(pb);
59 59

  
60 60
    if (size < 0)
61 61
        size = 0x7fffffff;
......
74 74
        return;
75 75
    }
76 76

  
77
    res = get_buffer(s->pb, str, size);
77
    res = avio_read(s->pb, str, size);
78 78
    if (res < 0)
79 79
        return;
80 80

  
......
93 93
    if (size & 1)
94 94
        size++;
95 95
    codec->codec_type = AVMEDIA_TYPE_AUDIO;
96
    codec->channels = get_be16(pb);
97
    num_frames = get_be32(pb);
98
    codec->bits_per_coded_sample = get_be16(pb);
96
    codec->channels = avio_rb16(pb);
97
    num_frames = avio_rb32(pb);
98
    codec->bits_per_coded_sample = avio_rb16(pb);
99 99

  
100
    get_buffer(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */
100
    avio_read(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */
101 101
    sample_rate = av_ext2dbl(ext);          /* 80 bits BE IEEE extended float */
102 102
    codec->sample_rate = sample_rate;
103 103
    size -= 18;
104 104

  
105 105
    /* Got an AIFF-C? */
106 106
    if (version == AIFF_C_VERSION1) {
107
        codec->codec_tag = get_le32(pb);
107
        codec->codec_tag = avio_rl32(pb);
108 108
        codec->codec_id  = ff_codec_get_id(ff_codec_aiff_tags, codec->codec_tag);
109 109

  
110 110
        switch (codec->codec_id) {
......
187 187
        return AVERROR_INVALIDDATA;
188 188

  
189 189
    /* AIFF data type */
190
    tag = get_le32(pb);
190
    tag = avio_rl32(pb);
191 191
    if (tag == MKTAG('A', 'I', 'F', 'F'))       /* Got an AIFF file */
192 192
        version = AIFF;
193 193
    else if (tag != MKTAG('A', 'I', 'F', 'C'))  /* An AIFF-C file then */
......
217 217
                goto got_sound;
218 218
            break;
219 219
        case MKTAG('F', 'V', 'E', 'R'):     /* Version chunk */
220
            version = get_be32(pb);
220
            version = avio_rb32(pb);
221 221
            break;
222 222
        case MKTAG('N', 'A', 'M', 'E'):     /* Sample name chunk */
223 223
            get_meta(s, "title"    , size);
......
233 233
            break;
234 234
        case MKTAG('S', 'S', 'N', 'D'):     /* Sampled sound chunk */
235 235
            aiff->data_end = url_ftell(pb) + size;
236
            offset = get_be32(pb);      /* Offset of sound data */
237
            get_be32(pb);               /* BlockSize... don't care */
236
            offset = avio_rb32(pb);      /* Offset of sound data */
237
            avio_rb32(pb);               /* BlockSize... don't care */
238 238
            offset += url_ftell(pb);    /* Compute absolute data offset */
239 239
            if (st->codec->block_align)    /* Assume COMM already parsed */
240 240
                goto got_sound;
......
251 251
            if (!st->codec->extradata)
252 252
                return AVERROR(ENOMEM);
253 253
            st->codec->extradata_size = size;
254
            get_buffer(pb, st->codec->extradata, size);
254
            avio_read(pb, st->codec->extradata, size);
255 255
            break;
256 256
        default: /* Jump */
257 257
            if (size & 1)   /* Always even aligned */

Also available in: Unified diff