Revision b7effd4e libavformat/mpc.c

View differences:

libavformat/mpc.c
55 55
    MPCContext *c = s->priv_data;
56 56
    AVStream *st;
57 57

  
58
    if(get_le24(s->pb) != MKTAG('M', 'P', '+', 0)){
58
    if(avio_rl24(s->pb) != MKTAG('M', 'P', '+', 0)){
59 59
        av_log(s, AV_LOG_ERROR, "Not a Musepack file\n");
60 60
        return -1;
61 61
    }
62
    c->ver = get_byte(s->pb);
62
    c->ver = avio_r8(s->pb);
63 63
    if(c->ver != 0x07 && c->ver != 0x17){
64 64
        av_log(s, AV_LOG_ERROR, "Can demux Musepack SV7, got version %02X\n", c->ver);
65 65
        return -1;
66 66
    }
67
    c->fcount = get_le32(s->pb);
67
    c->fcount = avio_rl32(s->pb);
68 68
    if((int64_t)c->fcount * sizeof(MPCFrame) >= UINT_MAX){
69 69
        av_log(s, AV_LOG_ERROR, "Too many frames, seeking is not possible\n");
70 70
        return -1;
......
85 85

  
86 86
    st->codec->extradata_size = 16;
87 87
    st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
88
    get_buffer(s->pb, st->codec->extradata, 16);
88
    avio_read(s->pb, st->codec->extradata, 16);
89 89
    st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3];
90 90
    av_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
91 91
    /* scan for seekpoints */
......
121 121
    c->curframe++;
122 122
    curbits = c->curbits;
123 123
    pos = url_ftell(s->pb);
124
    tmp = get_le32(s->pb);
124
    tmp = avio_rl32(s->pb);
125 125
    if(curbits <= 12){
126 126
        size2 = (tmp >> (12 - curbits)) & 0xFFFFF;
127 127
    }else{
128
        tmp = (tmp << 32) | get_le32(s->pb);
128
        tmp = (tmp << 32) | avio_rl32(s->pb);
129 129
        size2 = (tmp >> (44 - curbits)) & 0xFFFFF;
130 130
    }
131 131
    curbits += 20;
......
151 151

  
152 152
    pkt->stream_index = 0;
153 153
    pkt->pts = cur;
154
    ret = get_buffer(s->pb, pkt->data + 4, size);
154
    ret = avio_read(s->pb, pkt->data + 4, size);
155 155
    if(c->curbits)
156 156
        url_fseek(s->pb, -4, SEEK_CUR);
157 157
    if(ret < size){

Also available in: Unified diff