Revision e63a3628 libavformat/electronicarts.c

View differences:

libavformat/electronicarts.c
82 82
    int i;
83 83
    uint32_t word;
84 84

  
85
    size = get_byte(pb);
85
    size = avio_r8(pb);
86 86

  
87 87
    word = 0;
88 88
    for (i = 0; i < size; i++) {
89
        byte = get_byte(pb);
89
        byte = avio_r8(pb);
90 90
        word <<= 8;
91 91
        word |= byte;
92 92
    }
......
112 112
    while (!url_feof(pb) && inHeader) {
113 113
        int inSubheader;
114 114
        uint8_t byte;
115
        byte = get_byte(pb);
115
        byte = avio_r8(pb);
116 116

  
117 117
        switch (byte) {
118 118
        case 0xFD:
......
120 120
            inSubheader = 1;
121 121
            while (!url_feof(pb) && inSubheader) {
122 122
                uint8_t subbyte;
123
                subbyte = get_byte(pb);
123
                subbyte = avio_r8(pb);
124 124

  
125 125
                switch (subbyte) {
126 126
                case 0x80:
......
218 218
    AVIOContext *pb = s->pb;
219 219
    int compression_type;
220 220

  
221
    ea->sample_rate  = ea->big_endian ? get_be32(pb) : get_le32(pb);
222
    ea->bytes        = get_byte(pb);   /* 1=8-bit, 2=16-bit */
223
    ea->num_channels = get_byte(pb);
224
    compression_type = get_byte(pb);
221
    ea->sample_rate  = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
222
    ea->bytes        = avio_r8(pb);   /* 1=8-bit, 2=16-bit */
223
    ea->num_channels = avio_r8(pb);
224
    compression_type = avio_r8(pb);
225 225
    url_fskip(pb, 13);
226 226

  
227 227
    switch (compression_type) {
......
249 249
    EaDemuxContext *ea = s->priv_data;
250 250
    AVIOContext *pb = s->pb;
251 251

  
252
    ea->sample_rate  = get_le32(pb);
253
    ea->bytes        = get_le32(pb);  /* 1=8-bit, 2=16-bit */
254
    ea->num_channels = get_le32(pb);
252
    ea->sample_rate  = avio_rl32(pb);
253
    ea->bytes        = avio_rl32(pb);  /* 1=8-bit, 2=16-bit */
254
    ea->num_channels = avio_rl32(pb);
255 255
    ea->audio_codec  = CODEC_ID_ADPCM_IMA_EA_SEAD;
256 256

  
257 257
    return 1;
......
262 262
    EaDemuxContext *ea = s->priv_data;
263 263
    AVIOContext *pb = s->pb;
264 264
    url_fskip(pb, 4);
265
    ea->width  = get_le16(pb);
266
    ea->height = get_le16(pb);
265
    ea->width  = avio_rl16(pb);
266
    ea->height = avio_rl16(pb);
267 267
    ea->time_base = (AVRational){1,15};
268 268
    ea->video_codec = CODEC_ID_MDEC;
269 269
    return 1;
......
275 275
    AVIOContext *pb = s->pb;
276 276

  
277 277
    url_fskip(pb, 16);
278
    ea->time_base.den = get_le32(pb);
279
    ea->time_base.num = get_le32(pb);
278
    ea->time_base.den = avio_rl32(pb);
279
    ea->time_base.num = avio_rl32(pb);
280 280
    ea->video_codec = CODEC_ID_VP6;
281 281

  
282 282
    return 1;
......
296 296
        unsigned int startpos = url_ftell(pb);
297 297
        int err = 0;
298 298

  
299
        blockid = get_le32(pb);
300
        size = get_le32(pb);
299
        blockid = avio_rl32(pb);
300
        size = avio_rl32(pb);
301 301
        if (i == 0)
302 302
            ea->big_endian = size > 0x000FFFFF;
303 303
        if (ea->big_endian)
......
305 305

  
306 306
        switch (blockid) {
307 307
            case ISNh_TAG:
308
                if (get_le32(pb) != EACS_TAG) {
308
                if (avio_rl32(pb) != EACS_TAG) {
309 309
                    av_log (s, AV_LOG_ERROR, "unknown 1SNh headerid\n");
310 310
                    return 0;
311 311
                }
......
314 314

  
315 315
            case SCHl_TAG :
316 316
            case SHEN_TAG :
317
                blockid = get_le32(pb);
317
                blockid = avio_rl32(pb);
318 318
                if (blockid == GSTR_TAG) {
319 319
                    url_fskip(pb, 4);
320 320
                } else if ((blockid & 0xFFFF)!=PT00_TAG) {
......
467 467
    int av_uninit(num_samples);
468 468

  
469 469
    while (!packet_read) {
470
        chunk_type = get_le32(pb);
471
        chunk_size = (ea->big_endian ? get_be32(pb) : get_le32(pb)) - 8;
470
        chunk_type = avio_rl32(pb);
471
        chunk_size = (ea->big_endian ? avio_rb32(pb) : avio_rl32(pb)) - 8;
472 472

  
473 473
        switch (chunk_type) {
474 474
        /* audio data */
......
485 485
                break;
486 486
            } else if (ea->audio_codec == CODEC_ID_PCM_S16LE_PLANAR ||
487 487
                       ea->audio_codec == CODEC_ID_MP3) {
488
                num_samples = get_le32(pb);
488
                num_samples = avio_rl32(pb);
489 489
                url_fskip(pb, 8);
490 490
                chunk_size -= 12;
491 491
            }

Also available in: Unified diff