Revision b7effd4e libavformat/vocdec.c

View differences:

libavformat/vocdec.c
46 46
    AVStream *st;
47 47

  
48 48
    url_fskip(pb, 20);
49
    header_size = get_le16(pb) - 22;
49
    header_size = avio_rl16(pb) - 22;
50 50
    if (header_size != 4) {
51 51
        av_log(s, AV_LOG_ERROR, "unknown header size: %d\n", header_size);
52 52
        return AVERROR(ENOSYS);
......
73 73
    int channels = 1;
74 74

  
75 75
    while (!voc->remaining_size) {
76
        type = get_byte(pb);
76
        type = avio_r8(pb);
77 77
        if (type == VOC_TYPE_EOF)
78 78
            return AVERROR(EIO);
79
        voc->remaining_size = get_le24(pb);
79
        voc->remaining_size = avio_rl24(pb);
80 80
        if (!voc->remaining_size) {
81 81
            if (url_is_streamed(s->pb))
82 82
                return AVERROR(EIO);
......
86 86

  
87 87
        switch (type) {
88 88
        case VOC_TYPE_VOICE_DATA:
89
            dec->sample_rate = 1000000 / (256 - get_byte(pb));
89
            dec->sample_rate = 1000000 / (256 - avio_r8(pb));
90 90
            if (sample_rate)
91 91
                dec->sample_rate = sample_rate;
92 92
            dec->channels = channels;
93
            tmp_codec = get_byte(pb);
93
            tmp_codec = avio_r8(pb);
94 94
            dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id);
95 95
            voc->remaining_size -= 2;
96 96
            max_size -= 2;
......
101 101
            break;
102 102

  
103 103
        case VOC_TYPE_EXTENDED:
104
            sample_rate = get_le16(pb);
105
            get_byte(pb);
106
            channels = get_byte(pb) + 1;
104
            sample_rate = avio_rl16(pb);
105
            avio_r8(pb);
106
            channels = avio_r8(pb) + 1;
107 107
            sample_rate = 256000000 / (channels * (65536 - sample_rate));
108 108
            voc->remaining_size = 0;
109 109
            max_size -= 4;
110 110
            break;
111 111

  
112 112
        case VOC_TYPE_NEW_VOICE_DATA:
113
            dec->sample_rate = get_le32(pb);
114
            dec->bits_per_coded_sample = get_byte(pb);
115
            dec->channels = get_byte(pb);
116
            tmp_codec = get_le16(pb);
113
            dec->sample_rate = avio_rl32(pb);
114
            dec->bits_per_coded_sample = avio_r8(pb);
115
            dec->channels = avio_r8(pb);
116
            tmp_codec = avio_rl16(pb);
117 117
            url_fskip(pb, 4);
118 118
            voc->remaining_size -= 12;
119 119
            max_size -= 12;

Also available in: Unified diff