Revision e63a3628 libavformat/r3d.c

View differences:

libavformat/r3d.c
39 39
static int read_atom(AVFormatContext *s, Atom *atom)
40 40
{
41 41
    atom->offset = url_ftell(s->pb);
42
    atom->size = get_be32(s->pb);
42
    atom->size = avio_rb32(s->pb);
43 43
    if (atom->size < 8)
44 44
        return -1;
45
    atom->tag = get_le32(s->pb);
45
    atom->tag = avio_rl32(s->pb);
46 46
    av_dlog(s, "atom %d %.4s offset %#llx\n",
47 47
            atom->size, (char*)&atom->tag, atom->offset);
48 48
    return atom->size;
......
59 59
    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
60 60
    st->codec->codec_id = CODEC_ID_JPEG2000;
61 61

  
62
    tmp  = get_byte(s->pb); // major version
63
    tmp2 = get_byte(s->pb); // minor version
62
    tmp  = avio_r8(s->pb); // major version
63
    tmp2 = avio_r8(s->pb); // minor version
64 64
    av_dlog(s, "version %d.%d\n", tmp, tmp2);
65 65

  
66
    tmp = get_be16(s->pb); // unknown
66
    tmp = avio_rb16(s->pb); // unknown
67 67
    av_dlog(s, "unknown1 %d\n", tmp);
68 68

  
69
    tmp = get_be32(s->pb);
69
    tmp = avio_rb32(s->pb);
70 70
    av_set_pts_info(st, 32, 1, tmp);
71 71

  
72
    tmp = get_be32(s->pb); // filenum
72
    tmp = avio_rb32(s->pb); // filenum
73 73
    av_dlog(s, "filenum %d\n", tmp);
74 74

  
75 75
    url_fskip(s->pb, 32); // unknown
76 76

  
77
    st->codec->width  = get_be32(s->pb);
78
    st->codec->height = get_be32(s->pb);
77
    st->codec->width  = avio_rb32(s->pb);
78
    st->codec->height = avio_rb32(s->pb);
79 79

  
80
    tmp = get_be16(s->pb); // unknown
80
    tmp = avio_rb16(s->pb); // unknown
81 81
    av_dlog(s, "unknown2 %d\n", tmp);
82 82

  
83
    st->codec->time_base.den = get_be16(s->pb);
84
    st->codec->time_base.num = get_be16(s->pb);
83
    st->codec->time_base.den = avio_rb16(s->pb);
84
    st->codec->time_base.num = avio_rb16(s->pb);
85 85

  
86
    tmp = get_byte(s->pb); // audio channels
86
    tmp = avio_r8(s->pb); // audio channels
87 87
    av_dlog(s, "audio channels %d\n", tmp);
88 88
    if (tmp > 0) {
89 89
        AVStream *ast = av_new_stream(s, 1);
......
95 95
        av_set_pts_info(ast, 32, 1, st->time_base.den);
96 96
    }
97 97

  
98
    get_buffer(s->pb, filename, 257);
98
    avio_read(s->pb, filename, 257);
99 99
    filename[sizeof(filename)-1] = 0;
100 100
    av_metadata_set2(&st->metadata, "filename", filename, 0);
101 101

  
......
120 120
        return AVERROR(ENOMEM);
121 121

  
122 122
    for (i = 0; i < r3d->video_offsets_count; i++) {
123
        r3d->video_offsets[i] = get_be32(s->pb);
123
        r3d->video_offsets[i] = avio_rb32(s->pb);
124 124
        if (!r3d->video_offsets[i]) {
125 125
            r3d->video_offsets_count = i;
126 126
            break;
......
141 141
    R3DContext *r3d = s->priv_data;
142 142
    int tmp;
143 143

  
144
    r3d->rdvo_offset = get_be32(s->pb);
145
    get_be32(s->pb); // rdvs offset
146
    get_be32(s->pb); // rdao offset
147
    get_be32(s->pb); // rdas offset
144
    r3d->rdvo_offset = avio_rb32(s->pb);
145
    avio_rb32(s->pb); // rdvs offset
146
    avio_rb32(s->pb); // rdao offset
147
    avio_rb32(s->pb); // rdas offset
148 148

  
149
    tmp = get_be32(s->pb);
149
    tmp = avio_rb32(s->pb);
150 150
    av_dlog(s, "num video chunks %d\n", tmp);
151 151

  
152
    tmp = get_be32(s->pb);
152
    tmp = avio_rb32(s->pb);
153 153
    av_dlog(s, "num audio chunks %d\n", tmp);
154 154

  
155 155
    url_fskip(s->pb, 6*4);
......
214 214
    unsigned dts;
215 215
    int ret;
216 216

  
217
    dts = get_be32(s->pb);
217
    dts = avio_rb32(s->pb);
218 218

  
219
    tmp = get_be32(s->pb);
219
    tmp = avio_rb32(s->pb);
220 220
    av_dlog(s, "frame num %d\n", tmp);
221 221

  
222
    tmp  = get_byte(s->pb); // major version
223
    tmp2 = get_byte(s->pb); // minor version
222
    tmp  = avio_r8(s->pb); // major version
223
    tmp2 = avio_r8(s->pb); // minor version
224 224
    av_dlog(s, "version %d.%d\n", tmp, tmp2);
225 225

  
226
    tmp = get_be16(s->pb); // unknown
226
    tmp = avio_rb16(s->pb); // unknown
227 227
    av_dlog(s, "unknown %d\n", tmp);
228 228

  
229 229
    if (tmp > 4) {
230
        tmp = get_be16(s->pb); // unknown
230
        tmp = avio_rb16(s->pb); // unknown
231 231
        av_dlog(s, "unknown %d\n", tmp);
232 232

  
233
        tmp = get_be16(s->pb); // unknown
233
        tmp = avio_rb16(s->pb); // unknown
234 234
        av_dlog(s, "unknown %d\n", tmp);
235 235

  
236
        tmp = get_be32(s->pb);
236
        tmp = avio_rb32(s->pb);
237 237
        av_dlog(s, "width %d\n", tmp);
238
        tmp = get_be32(s->pb);
238
        tmp = avio_rb32(s->pb);
239 239
        av_dlog(s, "height %d\n", tmp);
240 240

  
241
        tmp = get_be32(s->pb);
241
        tmp = avio_rb32(s->pb);
242 242
        av_dlog(s, "metadata len %d\n", tmp);
243 243
    }
244 244
    tmp = atom->size - 8 - (url_ftell(s->pb) - pos);
......
268 268
    unsigned dts;
269 269
    int ret;
270 270

  
271
    dts = get_be32(s->pb);
271
    dts = avio_rb32(s->pb);
272 272

  
273
    st->codec->sample_rate = get_be32(s->pb);
273
    st->codec->sample_rate = avio_rb32(s->pb);
274 274

  
275
    samples = get_be32(s->pb);
275
    samples = avio_rb32(s->pb);
276 276

  
277
    tmp = get_be32(s->pb);
277
    tmp = avio_rb32(s->pb);
278 278
    av_dlog(s, "packet num %d\n", tmp);
279 279

  
280
    tmp = get_be16(s->pb); // unkown
280
    tmp = avio_rb16(s->pb); // unkown
281 281
    av_dlog(s, "unknown %d\n", tmp);
282 282

  
283
    tmp  = get_byte(s->pb); // major version
284
    tmp2 = get_byte(s->pb); // minor version
283
    tmp  = avio_r8(s->pb); // major version
284
    tmp2 = avio_r8(s->pb); // minor version
285 285
    av_dlog(s, "version %d.%d\n", tmp, tmp2);
286 286

  
287
    tmp = get_be32(s->pb); // unknown
287
    tmp = avio_rb32(s->pb); // unknown
288 288
    av_dlog(s, "unknown %d\n", tmp);
289 289

  
290 290
    size = atom->size - 8 - (url_ftell(s->pb) - pos);

Also available in: Unified diff