Revision b7effd4e libavformat/dxa.c

View differences:

libavformat/dxa.c
61 61
    int num, den;
62 62
    int flags;
63 63

  
64
    tag = get_le32(pb);
64
    tag = avio_rl32(pb);
65 65
    if (tag != MKTAG('D', 'E', 'X', 'A'))
66 66
        return -1;
67
    flags = get_byte(pb);
68
    c->frames = get_be16(pb);
67
    flags = avio_r8(pb);
68
    c->frames = avio_rb16(pb);
69 69
    if(!c->frames){
70 70
        av_log(s, AV_LOG_ERROR, "File contains no frames ???\n");
71 71
        return -1;
72 72
    }
73 73

  
74
    fps = get_be32(pb);
74
    fps = avio_rb32(pb);
75 75
    if(fps > 0){
76 76
        den = 1000;
77 77
        num = fps;
......
82 82
        den = 10;
83 83
        num = 1;
84 84
    }
85
    w = get_be16(pb);
86
    h = get_be16(pb);
85
    w = avio_rb16(pb);
86
    h = avio_rb16(pb);
87 87
    c->has_sound = 0;
88 88

  
89 89
    st = av_new_stream(s, 0);
......
91 91
        return -1;
92 92

  
93 93
    // Parse WAV data header
94
    if(get_le32(pb) == MKTAG('W', 'A', 'V', 'E')){
94
    if(avio_rl32(pb) == MKTAG('W', 'A', 'V', 'E')){
95 95
        uint32_t size, fsize;
96 96
        c->has_sound = 1;
97
        size = get_be32(pb);
97
        size = avio_rb32(pb);
98 98
        c->vidpos = url_ftell(pb) + size;
99 99
        url_fskip(pb, 16);
100
        fsize = get_le32(pb);
100
        fsize = avio_rl32(pb);
101 101

  
102 102
        ast = av_new_stream(s, 0);
103 103
        if (!ast)
......
105 105
        ff_get_wav_header(pb, ast->codec, fsize);
106 106
        // find 'data' chunk
107 107
        while(url_ftell(pb) < c->vidpos && !url_feof(pb)){
108
            tag = get_le32(pb);
109
            fsize = get_le32(pb);
108
            tag = avio_rl32(pb);
109
            fsize = avio_rl32(pb);
110 110
            if(tag == MKTAG('d', 'a', 't', 'a')) break;
111 111
            url_fskip(pb, fsize);
112 112
        }
......
163 163
    }
164 164
    url_fseek(s->pb, c->vidpos, SEEK_SET);
165 165
    while(!url_feof(s->pb) && c->frames){
166
        get_buffer(s->pb, buf, 4);
166
        avio_read(s->pb, buf, 4);
167 167
        switch(AV_RL32(buf)){
168 168
        case MKTAG('N', 'U', 'L', 'L'):
169 169
            if(av_new_packet(pkt, 4 + pal_size) < 0)
......
178 178
        case MKTAG('C', 'M', 'A', 'P'):
179 179
            pal_size = 768+4;
180 180
            memcpy(pal, buf, 4);
181
            get_buffer(s->pb, pal + 4, 768);
181
            avio_read(s->pb, pal + 4, 768);
182 182
            break;
183 183
        case MKTAG('F', 'R', 'A', 'M'):
184
            get_buffer(s->pb, buf + 4, DXA_EXTRA_SIZE - 4);
184
            avio_read(s->pb, buf + 4, DXA_EXTRA_SIZE - 4);
185 185
            size = AV_RB32(buf + 5);
186 186
            if(size > 0xFFFFFF){
187 187
                av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size);
......
190 190
            if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0)
191 191
                return AVERROR(ENOMEM);
192 192
            memcpy(pkt->data + pal_size, buf, DXA_EXTRA_SIZE);
193
            ret = get_buffer(s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size);
193
            ret = avio_read(s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size);
194 194
            if(ret != size){
195 195
                av_free_packet(pkt);
196 196
                return AVERROR(EIO);

Also available in: Unified diff