Revision e63a3628 libavformat/riff.c

View differences:

libavformat/riff.c
481 481
{
482 482
    int id;
483 483

  
484
    id = get_le16(pb);
484
    id = avio_rl16(pb);
485 485
    codec->codec_type = AVMEDIA_TYPE_AUDIO;
486 486
    codec->codec_tag = id;
487
    codec->channels = get_le16(pb);
488
    codec->sample_rate = get_le32(pb);
489
    codec->bit_rate = get_le32(pb) * 8;
490
    codec->block_align = get_le16(pb);
487
    codec->channels = avio_rl16(pb);
488
    codec->sample_rate = avio_rl32(pb);
489
    codec->bit_rate = avio_rl32(pb) * 8;
490
    codec->block_align = avio_rl16(pb);
491 491
    if (size == 14) {  /* We're dealing with plain vanilla WAVEFORMAT */
492 492
        codec->bits_per_coded_sample = 8;
493 493
    }else
494
        codec->bits_per_coded_sample = get_le16(pb);
494
        codec->bits_per_coded_sample = avio_rl16(pb);
495 495
    if (size >= 18) {  /* We're obviously dealing with WAVEFORMATEX */
496
        int cbSize = get_le16(pb); /* cbSize */
496
        int cbSize = avio_rl16(pb); /* cbSize */
497 497
        size -= 18;
498 498
        cbSize = FFMIN(size, cbSize);
499 499
        if (cbSize >= 22 && id == 0xfffe) { /* WAVEFORMATEXTENSIBLE */
500
            codec->bits_per_coded_sample = get_le16(pb);
501
            codec->channel_layout = get_le32(pb); /* dwChannelMask */
502
            id = get_le32(pb); /* 4 first bytes of GUID */
500
            codec->bits_per_coded_sample = avio_rl16(pb);
501
            codec->channel_layout = avio_rl32(pb); /* dwChannelMask */
502
            id = avio_rl32(pb); /* 4 first bytes of GUID */
503 503
            url_fskip(pb, 12); /* skip end of GUID */
504 504
            cbSize -= 22;
505 505
            size -= 22;
......
507 507
        codec->extradata_size = cbSize;
508 508
        if (cbSize > 0) {
509 509
            codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
510
            get_buffer(pb, codec->extradata, codec->extradata_size);
510
            avio_read(pb, codec->extradata, codec->extradata_size);
511 511
            size -= cbSize;
512 512
        }
513 513

  
......
547 547
int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
548 548
{
549 549
    int tag1;
550
    get_le32(pb); /* size */
551
    st->codec->width = get_le32(pb);
552
    st->codec->height = (int32_t)get_le32(pb);
553
    get_le16(pb); /* planes */
554
    st->codec->bits_per_coded_sample= get_le16(pb); /* depth */
555
    tag1 = get_le32(pb);
556
    get_le32(pb); /* ImageSize */
557
    get_le32(pb); /* XPelsPerMeter */
558
    get_le32(pb); /* YPelsPerMeter */
559
    get_le32(pb); /* ClrUsed */
560
    get_le32(pb); /* ClrImportant */
550
    avio_rl32(pb); /* size */
551
    st->codec->width = avio_rl32(pb);
552
    st->codec->height = (int32_t)avio_rl32(pb);
553
    avio_rl16(pb); /* planes */
554
    st->codec->bits_per_coded_sample= avio_rl16(pb); /* depth */
555
    tag1 = avio_rl32(pb);
556
    avio_rl32(pb); /* ImageSize */
557
    avio_rl32(pb); /* XPelsPerMeter */
558
    avio_rl32(pb); /* YPelsPerMeter */
559
    avio_rl32(pb); /* ClrUsed */
560
    avio_rl32(pb); /* ClrImportant */
561 561
    return tag1;
562 562
}
563 563
#endif // CONFIG_DEMUXERS

Also available in: Unified diff