Revision e63a3628 libavformat/mmf.c

View differences:

libavformat/mmf.c
188 188
    int64_t file_size, size;
189 189
    int rate, params;
190 190

  
191
    tag = get_le32(pb);
191
    tag = avio_rl32(pb);
192 192
    if (tag != MKTAG('M', 'M', 'M', 'D'))
193 193
        return -1;
194
    file_size = get_be32(pb);
194
    file_size = avio_rb32(pb);
195 195

  
196 196
    /* Skip some unused chunks that may or may not be present */
197 197
    for(;; url_fseek(pb, size, SEEK_CUR)) {
198
        tag = get_le32(pb);
199
        size = get_be32(pb);
198
        tag = avio_rl32(pb);
199
        size = avio_rb32(pb);
200 200
        if(tag == MKTAG('C','N','T','I')) continue;
201 201
        if(tag == MKTAG('O','P','D','A')) continue;
202 202
        break;
......
212 212
        return -1;
213 213
    }
214 214

  
215
    get_byte(pb); /* format type */
216
    get_byte(pb); /* sequence type */
217
    params = get_byte(pb); /* (channel << 7) | (format << 4) | rate */
215
    avio_r8(pb); /* format type */
216
    avio_r8(pb); /* sequence type */
217
    params = avio_r8(pb); /* (channel << 7) | (format << 4) | rate */
218 218
    rate = mmf_rate(params & 0x0f);
219 219
    if(rate  < 0) {
220 220
        av_log(s, AV_LOG_ERROR, "Invalid sample rate\n");
221 221
        return -1;
222 222
    }
223
    get_byte(pb); /* wave base bit */
224
    get_byte(pb); /* time base d */
225
    get_byte(pb); /* time base g */
223
    avio_r8(pb); /* wave base bit */
224
    avio_r8(pb); /* time base d */
225
    avio_r8(pb); /* time base g */
226 226

  
227 227
    /* Skip some unused chunks that may or may not be present */
228 228
    for(;; url_fseek(pb, size, SEEK_CUR)) {
229
        tag = get_le32(pb);
230
        size = get_be32(pb);
229
        tag = avio_rl32(pb);
230
        size = avio_rb32(pb);
231 231
        if(tag == MKTAG('A','t','s','q')) continue;
232 232
        if(tag == MKTAG('A','s','p','I')) continue;
233 233
        break;
......
280 280
        return AVERROR(EIO);
281 281
    pkt->stream_index = 0;
282 282

  
283
    ret = get_buffer(s->pb, pkt->data, pkt->size);
283
    ret = avio_read(s->pb, pkt->data, pkt->size);
284 284
    if (ret < 0)
285 285
        av_free_packet(pkt);
286 286

  

Also available in: Unified diff