Revision e63a3628 libavformat/segafilm.c

View differences:

libavformat/segafilm.c
89 89
    film->stereo_buffer_size = 0;
90 90

  
91 91
    /* load the main FILM header */
92
    if (get_buffer(pb, scratch, 16) != 16)
92
    if (avio_read(pb, scratch, 16) != 16)
93 93
        return AVERROR(EIO);
94 94
    data_offset = AV_RB32(&scratch[4]);
95 95
    film->version = AV_RB32(&scratch[8]);
......
97 97
    /* load the FDSC chunk */
98 98
    if (film->version == 0) {
99 99
        /* special case for Lemmings .film files; 20-byte header */
100
        if (get_buffer(pb, scratch, 20) != 20)
100
        if (avio_read(pb, scratch, 20) != 20)
101 101
            return AVERROR(EIO);
102 102
        /* make some assumptions about the audio parameters */
103 103
        film->audio_type = CODEC_ID_PCM_S8;
......
106 106
        film->audio_bits = 8;
107 107
    } else {
108 108
        /* normal Saturn .cpk files; 32-byte header */
109
        if (get_buffer(pb, scratch, 32) != 32)
109
        if (avio_read(pb, scratch, 32) != 32)
110 110
            return AVERROR(EIO);
111 111
        film->audio_samplerate = AV_RB16(&scratch[24]);
112 112
        film->audio_channels = scratch[21];
......
158 158
    }
159 159

  
160 160
    /* load the sample table */
161
    if (get_buffer(pb, scratch, 16) != 16)
161
    if (avio_read(pb, scratch, 16) != 16)
162 162
        return AVERROR(EIO);
163 163
    if (AV_RB32(&scratch[0]) != STAB_TAG)
164 164
        return AVERROR_INVALIDDATA;
......
174 174
    audio_frame_counter = 0;
175 175
    for (i = 0; i < film->sample_count; i++) {
176 176
        /* load the next sample record and transfer it to an internal struct */
177
        if (get_buffer(pb, scratch, 16) != 16) {
177
        if (avio_read(pb, scratch, 16) != 16) {
178 178
            av_free(film->sample_table);
179 179
            return AVERROR(EIO);
180 180
        }
......
225 225
        pkt->pos= url_ftell(pb);
226 226
        if (av_new_packet(pkt, sample->sample_size))
227 227
            return AVERROR(ENOMEM);
228
        get_buffer(pb, pkt->data, sample->sample_size);
228
        avio_read(pb, pkt->data, sample->sample_size);
229 229
    } else if ((sample->stream == film->audio_stream_index) &&
230 230
        (film->audio_channels == 2)) {
231 231
        /* stereo PCM needs to be interleaved */
......
241 241
        }
242 242

  
243 243
        pkt->pos= url_ftell(pb);
244
        ret = get_buffer(pb, film->stereo_buffer, sample->sample_size);
244
        ret = avio_read(pb, film->stereo_buffer, sample->sample_size);
245 245
        if (ret != sample->sample_size)
246 246
            ret = AVERROR(EIO);
247 247

  

Also available in: Unified diff