- for (i=0;i<s->nb_streams;i++) {
- AVIStream *avist= s->streams[i]->priv_data;
- int64_t ix, pos;
-
- avi_stream2fourcc(&tag[0], i, s->streams[i]->codec->codec_type);
- ix_tag[3] = '0' + i;
-
- /* Writing AVI OpenDML leaf index chunk */
- ix = url_ftell(pb);
- put_tag(pb, &ix_tag[0]); /* ix?? */
- put_le32(pb, avist->indexes.entry * 8 + 24);
- /* chunk size */
- put_le16(pb, 2); /* wLongsPerEntry */
- put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
- put_byte(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
- put_le32(pb, avist->indexes.entry);
- /* nEntriesInUse */
- put_tag(pb, &tag[0]); /* dwChunkId */
- put_le64(pb, avi->movi_list);/* qwBaseOffset */
- put_le32(pb, 0); /* dwReserved_3 (must be 0) */
-
- for (j=0; j<avist->indexes.entry; j++) {
- AVIIentry* ie = avi_get_ientry(&avist->indexes, j);
- put_le32(pb, ie->pos + 8);
- put_le32(pb, ((uint32_t)ie->len & ~0x80000000) |
+ for (i = 0; i < s->nb_streams; i++) {
+ AVIStream *avist = s->streams[i]->priv_data;
+ int64_t ix, pos;
+
+ avi_stream2fourcc(tag, i, s->streams[i]->codecpar->codec_type);
+ ix_tag[3] = '0' + i;
+
+ /* Writing AVI OpenDML leaf index chunk */
+ ix = avio_tell(pb);
+ ffio_wfourcc(pb, ix_tag); /* ix?? */
+ avio_wl32(pb, avist->indexes.entry * 8 + 24);
+ /* chunk size */
+ avio_wl16(pb, 2); /* wLongsPerEntry */
+ avio_w8(pb, 0); /* bIndexSubType (0 == frame index) */
+ avio_w8(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
+ avio_wl32(pb, avist->indexes.entry);
+ /* nEntriesInUse */
+ ffio_wfourcc(pb, tag); /* dwChunkId */
+ avio_wl64(pb, avi->movi_list); /* qwBaseOffset */
+ avio_wl32(pb, 0); /* dwReserved_3 (must be 0) */
+
+ for (j = 0; j < avist->indexes.entry; j++) {
+ AVIIentry *ie = avi_get_ientry(&avist->indexes, j);
+ avio_wl32(pb, ie->pos + 8);
+ avio_wl32(pb, ((uint32_t) ie->len & ~0x80000000) |