Revision a1b79792

View differences:

libavformat/amr.c
40 40

  
41 41
    if (enc->codec_id == CODEC_ID_AMR_NB)
42 42
    {
43
        put_tag(pb, AMR_header);       /* magic number */
43
        avio_write(pb, AMR_header,   sizeof(AMR_header)   - 1); /* magic number */
44 44
    }
45 45
    else if(enc->codec_id == CODEC_ID_AMR_WB)
46 46
    {
47
        put_tag(pb, AMRWB_header);       /* magic number */
47
        avio_write(pb, AMRWB_header, sizeof(AMRWB_header) - 1); /* magic number */
48 48
    }
49 49
    else
50 50
    {
libavformat/ffmetaenc.c
50 50

  
51 51
static int write_header(AVFormatContext *s)
52 52
{
53
    put_tag(s->pb, ID_STRING);
53
    avio_write(s->pb, ID_STRING, sizeof(ID_STRING) - 1);
54 54
    avio_w8(s->pb, '1');          // version
55 55
    avio_w8(s->pb, '\n');
56 56
    put_flush_packet(s->pb);
......
64 64
    write_tags(s->pb, s->metadata);
65 65

  
66 66
    for (i = 0; i < s->nb_streams; i++) {
67
        put_tag(s->pb, ID_STREAM);
67
        avio_write(s->pb, ID_STREAM, sizeof(ID_STREAM) - 1);
68 68
        avio_w8(s->pb, '\n');
69 69
        write_tags(s->pb, s->streams[i]->metadata);
70 70
    }
71 71

  
72 72
    for (i = 0; i < s->nb_chapters; i++) {
73 73
        AVChapter *ch = s->chapters[i];
74
        put_tag(s->pb, ID_CHAPTER);
74
        avio_write(s->pb, ID_CHAPTER, sizeof(ID_CHAPTER) - 1);
75 75
        avio_w8(s->pb, '\n');
76 76
        url_fprintf(s->pb, "TIMEBASE=%d/%d\n", ch->time_base.num, ch->time_base.den);
77 77
        url_fprintf(s->pb, "START=%"PRId64"\n", ch->start);
libavformat/flvenc.c
199 199
        }
200 200
        av_set_pts_info(s->streams[i], 32, 1, 1000); /* 32 bit pts in ms */
201 201
    }
202
    put_tag(pb,"FLV");
202
    avio_write(pb, "FLV", 3);
203 203
    avio_w8(pb,1);
204 204
    avio_w8(pb,   FLV_HEADER_FLAG_HASAUDIO * !!audio_enc
205 205
                 + FLV_HEADER_FLAG_HASVIDEO * !!video_enc);
libavformat/gif.c
114 114
    int i;
115 115
    unsigned int v;
116 116

  
117
    put_tag(pb, "GIF");
118
    put_tag(pb, "89a");
117
    avio_write(pb, "GIF", 3);
118
    avio_write(pb, "89a", 3);
119 119
    avio_wl16(pb, width);
120 120
    avio_wl16(pb, height);
121 121

  
......
162 162
    avio_w8(pb, 0x21);
163 163
    avio_w8(pb, 0xff);
164 164
    avio_w8(pb, 0x0b);
165
        put_tag(pb, "NETSCAPE2.0");  // bytes 4 to 14
165
        avio_write(pb, "NETSCAPE2.0", sizeof("NETSCAPE2.0") - 1);  // bytes 4 to 14
166 166
        avio_w8(pb, 0x03); // byte 15
167 167
        avio_w8(pb, 0x01); // byte 16
168 168
        avio_wl16(pb, (uint16_t)loop_count);
libavformat/gxfenc.c
224 224
    /* media file name */
225 225
    avio_w8(pb, TRACK_NAME);
226 226
    avio_w8(pb, strlen(ES_NAME_PATTERN) + 3);
227
    put_tag(pb, ES_NAME_PATTERN);
227
    avio_write(pb, ES_NAME_PATTERN, sizeof(ES_NAME_PATTERN) - 1);
228 228
    avio_wb16(pb, sc->media_info);
229 229
    avio_w8(pb, 0);
230 230

  
......
269 269
    GXFContext *gxf = s->priv_data;
270 270
    AVIOContext *pb = s->pb;
271 271
    int64_t pos;
272
    int len;
272 273
    const char *filename = strrchr(s->filename, '/');
273 274

  
274 275
    pos = url_ftell(pb);
......
279 280
        filename++;
280 281
    else
281 282
        filename = s->filename;
283
    len = strlen(filename);
284

  
282 285
    avio_w8(pb, MAT_NAME);
283
    avio_w8(pb, strlen(SERVER_PATH) + strlen(filename) + 1);
284
    put_tag(pb, SERVER_PATH);
285
    put_tag(pb, filename);
286
    avio_w8(pb, strlen(SERVER_PATH) + len + 1);
287
    avio_write(pb, SERVER_PATH, sizeof(SERVER_PATH) - 1);
288
    avio_write(pb, filename, len);
286 289
    avio_w8(pb, 0);
287 290

  
288 291
    /* first field */
libavformat/mmf.c
79 79
    avio_w8(pb, 0); /* code type */
80 80
    avio_w8(pb, 0); /* status */
81 81
    avio_w8(pb, 0); /* counts */
82
    put_tag(pb, "VN:libavcodec,"); /* metadata ("ST:songtitle,VN:version,...") */
82
    avio_write(pb, "VN:libavcodec,", sizeof("VN:libavcodec,") -1); /* metadata ("ST:songtitle,VN:version,...") */
83 83
    end_tag_be(pb, pos);
84 84

  
85 85
    avio_write(pb, "ATR\x00", 4);
libavformat/rmenc.c
184 184
            coded_frame_size = (stream->enc->bit_rate *
185 185
                                stream->enc->frame_size) / (8 * sample_rate);
186 186
            /* audio codec info */
187
            put_tag(s, ".ra");
187
            avio_write(s, ".ra", 3);
188 188
            avio_w8(s, 0xfd);
189 189
            avio_wb32(s, 0x00040000); /* version */
190 190
            ffio_wfourcc(s, ".ra4");
libavformat/swfenc.c
229 229
    else
230 230
        swf->samples_per_frame = (swf->audio_enc->sample_rate * rate_base) / rate;
231 231

  
232
    put_tag(pb, "FWS");
232
    avio_write(pb, "FWS", 3);
233 233

  
234 234
    if (!strcmp("avm2", s->oformat->name))
235 235
        version = 9;
......
361 361
            avio_wl16(pb, VIDEO_ID);
362 362
            put_swf_matrix(pb, 1 << FRAC_BITS, 0, 0, 1 << FRAC_BITS, 0, 0);
363 363
            avio_wl16(pb, swf->video_frame_number);
364
            put_tag(pb, "video");
364
            avio_write(pb, "video", 5);
365 365
            avio_w8(pb, 0x00);
366 366
            put_swf_end_tag(s);
367 367
        } else {

Also available in: Unified diff