Revision a2704c97 libavformat/gxfenc.c

View differences:

libavformat/gxfenc.c
125 125
    int64_t curpos;
126 126
    int size;
127 127

  
128
    size = url_ftell(pb) - pos;
128
    size = avio_tell(pb) - pos;
129 129
    if (size % 4) {
130 130
        gxf_write_padding(pb, 4 - size % 4);
131
        size = url_ftell(pb) - pos;
131
        size = avio_tell(pb) - pos;
132 132
    }
133
    curpos = url_ftell(pb);
133
    curpos = avio_tell(pb);
134 134
    avio_seek(pb, pos + 6, SEEK_SET);
135 135
    avio_wb32(pb, size);
136 136
    avio_seek(pb, curpos, SEEK_SET);
......
141 141
{
142 142
    int64_t curpos;
143 143

  
144
    curpos = url_ftell(pb);
144
    curpos = avio_tell(pb);
145 145
    avio_seek(pb, pos, SEEK_SET);
146 146
    avio_wb16(pb, curpos - pos - 2);
147 147
    avio_seek(pb, curpos, SEEK_SET);
......
218 218
    avio_w8(pb, sc->media_type + 0x80);
219 219
    avio_w8(pb, index + 0xC0);
220 220

  
221
    pos = url_ftell(pb);
221
    pos = avio_tell(pb);
222 222
    avio_wb16(pb, 0); /* size */
223 223

  
224 224
    /* media file name */
......
272 272
    int len;
273 273
    const char *filename = strrchr(s->filename, '/');
274 274

  
275
    pos = url_ftell(pb);
275
    pos = avio_tell(pb);
276 276
    avio_wb16(pb, 0); /* size */
277 277

  
278 278
    /* name */
......
322 322
    int64_t pos;
323 323
    int i;
324 324

  
325
    pos = url_ftell(pb);
325
    pos = avio_tell(pb);
326 326
    avio_wb16(pb, 0); /* size */
327 327
    for (i = 0; i < s->nb_streams; ++i)
328 328
        gxf_write_track_description(s, s->streams[i]->priv_data, i);
......
336 336
{
337 337
    GXFContext *gxf = s->priv_data;
338 338
    AVIOContext *pb = s->pb;
339
    int64_t pos = url_ftell(pb);
339
    int64_t pos = avio_tell(pb);
340 340

  
341 341
    if (!rewrite) {
342 342
        if (!(gxf->map_offsets_nb % 30)) {
......
366 366
{
367 367
    GXFContext *gxf = s->priv_data;
368 368
    AVIOContext *pb = s->pb;
369
    int64_t pos = url_ftell(pb);
369
    int64_t pos = avio_tell(pb);
370 370
    int fields_per_flt = (gxf->nb_fields+1) / 1000 + 1;
371 371
    int flt_entries = gxf->nb_fields / fields_per_flt;
372 372
    int i = 0;
......
442 442
{
443 443
    AVIOContext *pb = s->pb;
444 444
    GXFContext *gxf = s->priv_data;
445
    int64_t pos = url_ftell(pb);
445
    int64_t pos = avio_tell(pb);
446 446
    int i;
447 447

  
448 448
    gxf->umf_track_offset = pos - gxf->umf_start_offset;
......
455 455
    avio_wl16(pb, gxf->timecode_track.media_info);
456 456
    avio_wl16(pb, 1);
457 457

  
458
    return url_ftell(pb) - pos;
458
    return avio_tell(pb) - pos;
459 459
}
460 460

  
461 461
static int gxf_write_umf_media_mpeg(AVIOContext *pb, AVStream *st)
......
533 533
    int64_t pos;
534 534
    int i, j;
535 535

  
536
    pos = url_ftell(pb);
536
    pos = avio_tell(pb);
537 537
    gxf->umf_media_offset = pos - gxf->umf_start_offset;
538 538
    for (i = 0; i <= s->nb_streams; ++i) {
539 539
        GXFStreamContext *sc;
......
544 544
        else
545 545
            sc = s->streams[i]->priv_data;
546 546

  
547
        startpos = url_ftell(pb);
547
        startpos = avio_tell(pb);
548 548
        avio_wl16(pb, 0); /* length */
549 549
        avio_wl16(pb, sc->media_info);
550 550
        avio_wl16(pb, 0); /* reserved */
......
580 580
            }
581 581
        }
582 582

  
583
        curpos = url_ftell(pb);
583
        curpos = avio_tell(pb);
584 584
        avio_seek(pb, startpos, SEEK_SET);
585 585
        avio_wl16(pb, curpos - startpos);
586 586
        avio_seek(pb, curpos, SEEK_SET);
587 587
    }
588
    return url_ftell(pb) - pos;
588
    return avio_tell(pb) - pos;
589 589
}
590 590

  
591 591
static int gxf_write_umf_packet(AVFormatContext *s)
592 592
{
593 593
    GXFContext *gxf = s->priv_data;
594 594
    AVIOContext *pb = s->pb;
595
    int64_t pos = url_ftell(pb);
595
    int64_t pos = avio_tell(pb);
596 596

  
597 597
    gxf_write_packet_header(pb, PKT_UMF);
598 598

  
......
600 600
    avio_w8(pb, 3); /* first and last (only) packet */
601 601
    avio_wb32(pb, gxf->umf_length); /* data length */
602 602

  
603
    gxf->umf_start_offset = url_ftell(pb);
603
    gxf->umf_start_offset = avio_tell(pb);
604 604
    gxf_write_umf_payload(s);
605 605
    gxf_write_umf_material_description(s);
606 606
    gxf->umf_track_size = gxf_write_umf_track_description(s);
607 607
    gxf->umf_media_size = gxf_write_umf_media_description(s);
608
    gxf->umf_length = url_ftell(pb) - gxf->umf_start_offset;
608
    gxf->umf_length = avio_tell(pb) - gxf->umf_start_offset;
609 609
    return updatePacketSize(pb, pos);
610 610
}
611 611

  
......
759 759

  
760 760
static int gxf_write_eos_packet(AVIOContext *pb)
761 761
{
762
    int64_t pos = url_ftell(pb);
762
    int64_t pos = avio_tell(pb);
763 763

  
764 764
    gxf_write_packet_header(pb, PKT_EOS);
765 765
    return updatePacketSize(pb, pos);
......
775 775
    ff_audio_interleave_close(s);
776 776

  
777 777
    gxf_write_eos_packet(pb);
778
    end = url_ftell(pb);
778
    end = avio_tell(pb);
779 779
    avio_seek(pb, 0, SEEK_SET);
780 780
    /* overwrite map, flt and umf packets with new values */
781 781
    gxf_write_map_packet(s, 1);
......
861 861
    GXFContext *gxf = s->priv_data;
862 862
    AVIOContext *pb = s->pb;
863 863
    AVStream *st = s->streams[pkt->stream_index];
864
    int64_t pos = url_ftell(pb);
864
    int64_t pos = avio_tell(pb);
865 865
    int padding = 0;
866
    int packet_start_offset = url_ftell(pb) / 1024;
866
    int packet_start_offset = avio_tell(pb) / 1024;
867 867

  
868 868
    gxf_write_packet_header(pb, PKT_MEDIA);
869 869
    if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO && pkt->size % 4) /* MPEG-2 frames must be padded */

Also available in: Unified diff