diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-03-03 20:11:45 +0100 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-03-04 11:26:57 -0500 |
commit | a2704c9712ad35cc22e7e0d8a79b581c07fa383b (patch) | |
tree | ebf5a27a98dbd52d983e38e901661f7525b38e9a /libavformat/gxfenc.c | |
parent | e16ead0716c2f988d1e26369a4c67b354ff86134 (diff) | |
download | ffmpeg-a2704c9712ad35cc22e7e0d8a79b581c07fa383b.tar.gz |
avio: add avio_tell macro as a replacement for url_ftell
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/gxfenc.c')
-rw-r--r-- | libavformat/gxfenc.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 66accb3e08..ea9755fcd2 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -125,12 +125,12 @@ static int64_t updatePacketSize(AVIOContext *pb, int64_t pos) int64_t curpos; int size; - size = url_ftell(pb) - pos; + size = avio_tell(pb) - pos; if (size % 4) { gxf_write_padding(pb, 4 - size % 4); - size = url_ftell(pb) - pos; + size = avio_tell(pb) - pos; } - curpos = url_ftell(pb); + curpos = avio_tell(pb); avio_seek(pb, pos + 6, SEEK_SET); avio_wb32(pb, size); avio_seek(pb, curpos, SEEK_SET); @@ -141,7 +141,7 @@ static int64_t updateSize(AVIOContext *pb, int64_t pos) { int64_t curpos; - curpos = url_ftell(pb); + curpos = avio_tell(pb); avio_seek(pb, pos, SEEK_SET); avio_wb16(pb, curpos - pos - 2); avio_seek(pb, curpos, SEEK_SET); @@ -218,7 +218,7 @@ static int gxf_write_track_description(AVFormatContext *s, GXFStreamContext *sc, avio_w8(pb, sc->media_type + 0x80); avio_w8(pb, index + 0xC0); - pos = url_ftell(pb); + pos = avio_tell(pb); avio_wb16(pb, 0); /* size */ /* media file name */ @@ -272,7 +272,7 @@ static int gxf_write_material_data_section(AVFormatContext *s) int len; const char *filename = strrchr(s->filename, '/'); - pos = url_ftell(pb); + pos = avio_tell(pb); avio_wb16(pb, 0); /* size */ /* name */ @@ -322,7 +322,7 @@ static int gxf_write_track_description_section(AVFormatContext *s) int64_t pos; int i; - pos = url_ftell(pb); + pos = avio_tell(pb); avio_wb16(pb, 0); /* size */ for (i = 0; i < s->nb_streams; ++i) gxf_write_track_description(s, s->streams[i]->priv_data, i); @@ -336,7 +336,7 @@ static int gxf_write_map_packet(AVFormatContext *s, int rewrite) { GXFContext *gxf = s->priv_data; AVIOContext *pb = s->pb; - int64_t pos = url_ftell(pb); + int64_t pos = avio_tell(pb); if (!rewrite) { if (!(gxf->map_offsets_nb % 30)) { @@ -366,7 +366,7 @@ static int gxf_write_flt_packet(AVFormatContext *s) { GXFContext *gxf = s->priv_data; AVIOContext *pb = s->pb; - int64_t pos = url_ftell(pb); + int64_t pos = avio_tell(pb); int fields_per_flt = (gxf->nb_fields+1) / 1000 + 1; int flt_entries = gxf->nb_fields / fields_per_flt; int i = 0; @@ -442,7 +442,7 @@ static int gxf_write_umf_track_description(AVFormatContext *s) { AVIOContext *pb = s->pb; GXFContext *gxf = s->priv_data; - int64_t pos = url_ftell(pb); + int64_t pos = avio_tell(pb); int i; gxf->umf_track_offset = pos - gxf->umf_start_offset; @@ -455,7 +455,7 @@ static int gxf_write_umf_track_description(AVFormatContext *s) avio_wl16(pb, gxf->timecode_track.media_info); avio_wl16(pb, 1); - return url_ftell(pb) - pos; + return avio_tell(pb) - pos; } static int gxf_write_umf_media_mpeg(AVIOContext *pb, AVStream *st) @@ -533,7 +533,7 @@ static int gxf_write_umf_media_description(AVFormatContext *s) int64_t pos; int i, j; - pos = url_ftell(pb); + pos = avio_tell(pb); gxf->umf_media_offset = pos - gxf->umf_start_offset; for (i = 0; i <= s->nb_streams; ++i) { GXFStreamContext *sc; @@ -544,7 +544,7 @@ static int gxf_write_umf_media_description(AVFormatContext *s) else sc = s->streams[i]->priv_data; - startpos = url_ftell(pb); + startpos = avio_tell(pb); avio_wl16(pb, 0); /* length */ avio_wl16(pb, sc->media_info); avio_wl16(pb, 0); /* reserved */ @@ -580,19 +580,19 @@ static int gxf_write_umf_media_description(AVFormatContext *s) } } - curpos = url_ftell(pb); + curpos = avio_tell(pb); avio_seek(pb, startpos, SEEK_SET); avio_wl16(pb, curpos - startpos); avio_seek(pb, curpos, SEEK_SET); } - return url_ftell(pb) - pos; + return avio_tell(pb) - pos; } static int gxf_write_umf_packet(AVFormatContext *s) { GXFContext *gxf = s->priv_data; AVIOContext *pb = s->pb; - int64_t pos = url_ftell(pb); + int64_t pos = avio_tell(pb); gxf_write_packet_header(pb, PKT_UMF); @@ -600,12 +600,12 @@ static int gxf_write_umf_packet(AVFormatContext *s) avio_w8(pb, 3); /* first and last (only) packet */ avio_wb32(pb, gxf->umf_length); /* data length */ - gxf->umf_start_offset = url_ftell(pb); + gxf->umf_start_offset = avio_tell(pb); gxf_write_umf_payload(s); gxf_write_umf_material_description(s); gxf->umf_track_size = gxf_write_umf_track_description(s); gxf->umf_media_size = gxf_write_umf_media_description(s); - gxf->umf_length = url_ftell(pb) - gxf->umf_start_offset; + gxf->umf_length = avio_tell(pb) - gxf->umf_start_offset; return updatePacketSize(pb, pos); } @@ -759,7 +759,7 @@ static int gxf_write_header(AVFormatContext *s) static int gxf_write_eos_packet(AVIOContext *pb) { - int64_t pos = url_ftell(pb); + int64_t pos = avio_tell(pb); gxf_write_packet_header(pb, PKT_EOS); return updatePacketSize(pb, pos); @@ -775,7 +775,7 @@ static int gxf_write_trailer(AVFormatContext *s) ff_audio_interleave_close(s); gxf_write_eos_packet(pb); - end = url_ftell(pb); + end = avio_tell(pb); avio_seek(pb, 0, SEEK_SET); /* overwrite map, flt and umf packets with new values */ gxf_write_map_packet(s, 1); @@ -861,9 +861,9 @@ static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt) GXFContext *gxf = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = s->streams[pkt->stream_index]; - int64_t pos = url_ftell(pb); + int64_t pos = avio_tell(pb); int padding = 0; - int packet_start_offset = url_ftell(pb) / 1024; + int packet_start_offset = avio_tell(pb) / 1024; gxf_write_packet_header(pb, PKT_MEDIA); if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO && pkt->size % 4) /* MPEG-2 frames must be padded */ |