Revision cea65433 libavformat/aiffdec.c

View differences:

libavformat/aiffdec.c
127 127
            codec->block_align = 33;
128 128
            codec->frame_size = 160;
129 129
            break;
130
        case CODEC_ID_QCELP:
131
            codec->block_align = 35;
132
            codec->frame_size= 160;
133
            break;
130 134
        default:
131 135
            break;
132 136
        }
......
284 288
    AVStream *st = s->streams[0];
285 289
    AIFFInputContext *aiff = s->priv_data;
286 290
    int64_t max_size;
287
    int res;
291
    int res, size;
288 292

  
289 293
    /* calculate size of remaining data */
290 294
    max_size = aiff->data_end - url_ftell(s->pb);
......
292 296
        return AVERROR_EOF;
293 297

  
294 298
    /* Now for that packet */
295
    max_size = FFMIN(max_size, (MAX_SIZE / st->codec->block_align) * st->codec->block_align);
296
    res = av_get_packet(s->pb, pkt, max_size);
299
    if (st->codec->block_align >= 33) // GSM, QCLP, IMA4
300
        size = st->codec->block_align;
301
    else
302
        size = (MAX_SIZE / st->codec->block_align) * st->codec->block_align;
303
    size = FFMIN(max_size, size);
304
    res = av_get_packet(s->pb, pkt, size);
297 305
    if (res < 0)
298 306
        return res;
299 307

  

Also available in: Unified diff