Revision e63a3628 libavformat/dsicin.c

View differences:

libavformat/dsicin.c
73 73
static int cin_read_file_header(CinDemuxContext *cin, AVIOContext *pb) {
74 74
    CinFileHeader *hdr = &cin->file_header;
75 75

  
76
    if (get_le32(pb) != 0x55AA0000)
76
    if (avio_rl32(pb) != 0x55AA0000)
77 77
        return AVERROR_INVALIDDATA;
78 78

  
79
    hdr->video_frame_size   = get_le32(pb);
80
    hdr->video_frame_width  = get_le16(pb);
81
    hdr->video_frame_height = get_le16(pb);
82
    hdr->audio_frequency    = get_le32(pb);
83
    hdr->audio_bits         = get_byte(pb);
84
    hdr->audio_stereo       = get_byte(pb);
85
    hdr->audio_frame_size   = get_le16(pb);
79
    hdr->video_frame_size   = avio_rl32(pb);
80
    hdr->video_frame_width  = avio_rl16(pb);
81
    hdr->video_frame_height = avio_rl16(pb);
82
    hdr->audio_frequency    = avio_rl32(pb);
83
    hdr->audio_bits         = avio_r8(pb);
84
    hdr->audio_stereo       = avio_r8(pb);
85
    hdr->audio_frame_size   = avio_rl16(pb);
86 86

  
87 87
    if (hdr->audio_frequency != 22050 || hdr->audio_bits != 16 || hdr->audio_stereo != 0)
88 88
        return AVERROR_INVALIDDATA;
......
141 141
static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) {
142 142
    CinFrameHeader *hdr = &cin->frame_header;
143 143

  
144
    hdr->video_frame_type = get_byte(pb);
145
    hdr->audio_frame_type = get_byte(pb);
146
    hdr->pal_colors_count = get_le16(pb);
147
    hdr->video_frame_size = get_le32(pb);
148
    hdr->audio_frame_size = get_le32(pb);
144
    hdr->video_frame_type = avio_r8(pb);
145
    hdr->audio_frame_type = avio_r8(pb);
146
    hdr->pal_colors_count = avio_rl16(pb);
147
    hdr->video_frame_size = avio_rl32(pb);
148
    hdr->audio_frame_size = avio_rl32(pb);
149 149

  
150 150
    if (url_feof(pb) || url_ferror(pb))
151 151
        return AVERROR(EIO);
152 152

  
153
    if (get_le32(pb) != 0xAA55AA55)
153
    if (avio_rl32(pb) != 0xAA55AA55)
154 154
        return AVERROR_INVALIDDATA;
155 155

  
156 156
    return 0;
......
191 191
        pkt->data[2] = hdr->pal_colors_count >> 8;
192 192
        pkt->data[3] = hdr->video_frame_type;
193 193

  
194
        ret = get_buffer(pb, &pkt->data[4], pkt_size);
194
        ret = avio_read(pb, &pkt->data[4], pkt_size);
195 195
        if (ret < 0) {
196 196
            av_free_packet(pkt);
197 197
            return ret;

Also available in: Unified diff