Revision 32442930 libavformat/avienc.c

View differences:

libavformat/avienc.c
20 20
 */
21 21
#include "avformat.h"
22 22
#include "avi.h"
23
#include "avio_internal.h"
23 24
#include "riff.h"
24 25
#include "libavutil/intreadwrite.h"
25 26

  
......
77 78
    }
78 79

  
79 80
    avi->riff_start = ff_start_tag(pb, "RIFF");
80
    put_tag(pb, riff_tag);
81
    ffio_wfourcc(pb, riff_tag);
81 82
    loff = ff_start_tag(pb, "LIST");
82
    put_tag(pb, list_tag);
83
    ffio_wfourcc(pb, list_tag);
83 84
    return loff;
84 85
}
85 86

  
......
107 108
    int len = strlen(str);
108 109
    if (len > 0) {
109 110
        len++;
110
        put_tag(pb, tag);
111
        ffio_wfourcc(pb, tag);
111 112
        avio_wl32(pb, len);
112 113
        avio_put_str(pb, str);
113 114
        if (len & 1)
......
175 176
    list1 = avi_start_new_riff(s, pb, "AVI ", "hdrl");
176 177

  
177 178
    /* avi header */
178
    put_tag(pb, "avih");
179
    ffio_wfourcc(pb, "avih");
179 180
    avio_wl32(pb, 14 * 4);
180 181
    bitrate = 0;
181 182

  
......
221 222
    for(i=0;i<n;i++) {
222 223
        AVIStream *avist= s->streams[i]->priv_data;
223 224
        list2 = ff_start_tag(pb, "LIST");
224
        put_tag(pb, "strl");
225
        ffio_wfourcc(pb, "strl");
225 226

  
226 227
        stream = s->streams[i]->codec;
227 228

  
......
235 236
                av_log(s, AV_LOG_ERROR, "Subtitle streams other than DivX XSUB are not supported by the AVI muxer.\n");
236 237
                return AVERROR_PATCHWELCOME;
237 238
            }
238
        case AVMEDIA_TYPE_VIDEO: put_tag(pb, "vids"); break;
239
        case AVMEDIA_TYPE_AUDIO: put_tag(pb, "auds"); break;
240
//        case AVMEDIA_TYPE_TEXT : put_tag(pb, "txts"); break;
241
        case AVMEDIA_TYPE_DATA : put_tag(pb, "dats"); break;
239
        case AVMEDIA_TYPE_VIDEO: ffio_wfourcc(pb, "vids"); break;
240
        case AVMEDIA_TYPE_AUDIO: ffio_wfourcc(pb, "auds"); break;
241
//      case AVMEDIA_TYPE_TEXT : ffio_wfourcc(pb, "txts"); break;
242
        case AVMEDIA_TYPE_DATA : ffio_wfourcc(pb, "dats"); break;
242 243
        }
243 244
        if(stream->codec_type == AVMEDIA_TYPE_VIDEO ||
244 245
           stream->codec_id == CODEC_ID_XSUB)
......
317 318
            avio_w8(pb, 0);          /* bIndexSubType (0 == frame index) */
318 319
            avio_w8(pb, 0);          /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
319 320
            avio_wl32(pb, 0);        /* nEntriesInUse (will fill out later on) */
320
            put_tag(pb, avi_stream2fourcc(&tag[0], i, stream->codec_type));
321
            ffio_wfourcc(pb, avi_stream2fourcc(&tag[0], i, stream->codec_type));
321 322
                                    /* dwChunkId */
322 323
            avio_wl64(pb, 0);        /* dwReserved[3]
323 324
            avio_wl32(pb, 0);           Must be 0.    */
......
364 365
    if (!url_is_streamed(pb)) {
365 366
        /* AVI could become an OpenDML one, if it grows beyond 2Gb range */
366 367
        avi->odml_list = ff_start_tag(pb, "JUNK");
367
        put_tag(pb, "odml");
368
        put_tag(pb, "dmlh");
368
        ffio_wfourcc(pb, "odml");
369
        ffio_wfourcc(pb, "dmlh");
369 370
        avio_wl32(pb, 248);
370 371
        for (i = 0; i < 248; i+= 4)
371 372
             avio_wl32(pb, 0);
......
375 376
    ff_end_tag(pb, list1);
376 377

  
377 378
    list2 = ff_start_tag(pb, "LIST");
378
    put_tag(pb, "INFO");
379
    ffio_wfourcc(pb, "INFO");
379 380
    ff_metadata_conv(&s->metadata, ff_avi_metadata_conv, NULL);
380 381
    for (i = 0; *ff_avi_tags[i]; i++) {
381 382
        if ((t = av_metadata_get(s->metadata, ff_avi_tags[i], NULL, AV_METADATA_MATCH_CASE)))
......
390 391
    ff_end_tag(pb, list2);
391 392

  
392 393
    avi->movi_list = ff_start_tag(pb, "LIST");
393
    put_tag(pb, "movi");
394
    ffio_wfourcc(pb, "movi");
394 395

  
395 396
    put_flush_packet(pb);
396 397

  
......
419 420

  
420 421
         /* Writing AVI OpenDML leaf index chunk */
421 422
         ix = url_ftell(pb);
422
         put_tag(pb, &ix_tag[0]);     /* ix?? */
423
         ffio_wfourcc(pb, &ix_tag[0]);     /* ix?? */
423 424
         avio_wl32(pb, avist->indexes.entry * 8 + 24);
424 425
                                      /* chunk size */
425 426
         avio_wl16(pb, 2);             /* wLongsPerEntry */
......
427 428
         avio_w8(pb, 1);             /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
428 429
         avio_wl32(pb, avist->indexes.entry);
429 430
                                      /* nEntriesInUse */
430
         put_tag(pb, &tag[0]);        /* dwChunkId */
431
         ffio_wfourcc(pb, &tag[0]);    /* dwChunkId */
431 432
         avio_wl64(pb, avi->movi_list);/* qwBaseOffset */
432 433
         avio_wl32(pb, 0);             /* dwReserved_3 (must be 0) */
433 434

  
......
442 443

  
443 444
         /* Updating one entry in the AVI OpenDML master index */
444 445
         url_fseek(pb, avist->indexes.indx_start - 8, SEEK_SET);
445
         put_tag(pb, "indx");                 /* enabling this entry */
446
         ffio_wfourcc(pb, "indx");            /* enabling this entry */
446 447
         url_fskip(pb, 8);
447 448
         avio_wl32(pb, avi->riff_id);         /* nEntriesInUse */
448 449
         url_fskip(pb, 16*avi->riff_id);
......
492 493
                avist= s->streams[stream_id]->priv_data;
493 494
                avi_stream2fourcc(&tag[0], stream_id,
494 495
                                  s->streams[stream_id]->codec->codec_type);
495
                put_tag(pb, &tag[0]);
496
                ffio_wfourcc(pb, &tag[0]);
496 497
                avio_wl32(pb, ie->flags);
497 498
                avio_wl32(pb, ie->pos);
498 499
                avio_wl32(pb, ie->len);
......
601 602

  
602 603
            file_size = url_ftell(pb);
603 604
            url_fseek(pb, avi->odml_list - 8, SEEK_SET);
604
            put_tag(pb, "LIST"); /* Making this AVI OpenDML one */
605
            ffio_wfourcc(pb, "LIST"); /* Making this AVI OpenDML one */
605 606
            url_fskip(pb, 16);
606 607

  
607 608
            for (n=nb_frames=0;n<s->nb_streams;n++) {

Also available in: Unified diff