Revision b7effd4e libavformat/qcp.c

View differences:

libavformat/qcp.c
91 91
    if (!st)
92 92
        return AVERROR(ENOMEM);
93 93

  
94
    get_be32(pb);                    // "RIFF"
95
    s->file_size = get_le32(pb) + 8;
94
    avio_rb32(pb);                    // "RIFF"
95
    s->file_size = avio_rl32(pb) + 8;
96 96
    url_fskip(pb, 8 + 4 + 1 + 1);    // "QLCMfmt " + chunk-size + major-version + minor-version
97 97

  
98 98
    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
99 99
    st->codec->channels   = 1;
100
    get_buffer(pb, buf, 16);
100
    avio_read(pb, buf, 16);
101 101
    if (is_qcelp_13k_guid(buf)) {
102 102
        st->codec->codec_id = CODEC_ID_QCELP;
103 103
    } else if (!memcmp(buf, guid_evrc, 16)) {
......
111 111
        return AVERROR_INVALIDDATA;
112 112
    }
113 113
    url_fskip(pb, 2 + 80); // codec-version + codec-name
114
    st->codec->bit_rate = get_le16(pb);
114
    st->codec->bit_rate = avio_rl16(pb);
115 115

  
116
    s->packet_size = get_le16(pb);
116
    s->packet_size = avio_rl16(pb);
117 117
    url_fskip(pb, 2); // block-size
118
    st->codec->sample_rate = get_le16(pb);
118
    st->codec->sample_rate = avio_rl16(pb);
119 119
    url_fskip(pb, 2); // sample-size
120 120

  
121 121
    memset(c->rates_per_mode, -1, sizeof(c->rates_per_mode));
122
    nb_rates = get_le32(pb);
122
    nb_rates = avio_rl32(pb);
123 123
    nb_rates = FFMIN(nb_rates, 8);
124 124
    for (i=0; i<nb_rates; i++) {
125
        int size = get_byte(pb);
126
        int mode = get_byte(pb);
125
        int size = avio_r8(pb);
126
        int mode = avio_r8(pb);
127 127
        if (mode > QCP_MAX_MODE) {
128 128
            av_log(s, AV_LOG_WARNING, "Unknown entry %d=>%d in rate-map-table.\n ", mode, size);
129 129
        } else
......
142 142

  
143 143
    while(!url_feof(pb)) {
144 144
        if (c->data_size) {
145
            int pkt_size, ret, mode = get_byte(pb);
145
            int pkt_size, ret, mode = avio_r8(pb);
146 146

  
147 147
            if (s->packet_size) {
148 148
                pkt_size = s->packet_size - 1;
......
165 165
            return ret;
166 166
        }
167 167

  
168
        if (url_ftell(pb) & 1 && get_byte(pb))
168
        if (url_ftell(pb) & 1 && avio_r8(pb))
169 169
            av_log(s, AV_LOG_WARNING, "Padding should be 0.\n");
170 170

  
171
        tag        = get_le32(pb);
172
        chunk_size = get_le32(pb);
171
        tag        = avio_rl32(pb);
172
        chunk_size = avio_rl32(pb);
173 173
        switch (tag) {
174 174
        case MKTAG('v', 'r', 'a', 't'):
175
            if (get_le32(pb)) // var-rate-flag
175
            if (avio_rl32(pb)) // var-rate-flag
176 176
                s->packet_size = 0;
177 177
            url_fskip(pb, 4); // size-in-packets
178 178
            break;

Also available in: Unified diff