diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-03-03 22:11:45 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-05 04:29:31 +0300 |
commit | 384c9c2fa79f2f09ed4a5aa4c14ba3ffc6bdc790 (patch) | |
tree | a3ec8979530bffeb61b84161d1681120bf1234af /libavformat/mov.c | |
parent | 773947ba76c575abc01ba128206c87440dad40ec (diff) |
avio: add avio_tell macro as a replacement for url_ftell
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit a2704c9712ad35cc22e7e0d8a79b581c07fa383b)
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index ad5bada180..e9435a93c6 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -298,7 +298,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (!parse) { /* skip leaf atoms data */ avio_seek(pb, a.size, SEEK_CUR); } else { - int64_t start_pos = url_ftell(pb); + int64_t start_pos = avio_tell(pb); int64_t left; int err = parse(c, pb, a); if (err < 0) @@ -306,7 +306,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (c->found_moov && c->found_mdat && (url_is_streamed(pb) || start_pos + a.size == url_fsize(pb))) return 0; - left = a.size - url_ftell(pb) + start_pos; + left = a.size - avio_tell(pb) + start_pos; if (left > 0) /* skip garbage at atom end */ avio_seek(pb, left, SEEK_CUR); } @@ -343,7 +343,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) for (i = 0; i < sc->drefs_count; i++) { MOVDref *dref = &sc->drefs[i]; uint32_t size = avio_rb32(pb); - int64_t next = url_ftell(pb) + size - 4; + int64_t next = avio_tell(pb) + size - 4; if (size < 12) return -1; @@ -383,7 +383,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_seek(pb, 16, SEEK_CUR); - for (type = 0; type != -1 && url_ftell(pb) < next; ) { + for (type = 0; type != -1 && avio_tell(pb) < next; ) { type = avio_rb16(pb); len = avio_rb16(pb); av_log(c->fc, AV_LOG_DEBUG, "type %d, len %d\n", type, len); @@ -583,7 +583,7 @@ static int mov_read_moov(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom) { - c->fragment.moof_offset = url_ftell(pb) - 8; + c->fragment.moof_offset = avio_tell(pb) - 8; av_dlog(c->fc, "moof offset %llx\n", c->fragment.moof_offset); return mov_read_default(c, pb, atom); } @@ -925,7 +925,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) enum CodecID id; int dref_id = 1; MOVAtom a = { AV_RL32("stsd") }; - int64_t start_pos = url_ftell(pb); + int64_t start_pos = avio_tell(pb); int size = avio_rb32(pb); /* size */ uint32_t format = avio_rl32(pb); /* data format */ @@ -945,7 +945,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) * in the MOV demuxer, patch welcome. */ multiple_stsd: av_log(c->fc, AV_LOG_WARNING, "multiple fourcc not supported\n"); - avio_seek(pb, size - (url_ftell(pb) - start_pos), SEEK_CUR); + avio_seek(pb, size - (avio_tell(pb) - start_pos), SEEK_CUR); continue; } /* we cannot demux concatenated h264 streams because of different extradata */ @@ -1166,7 +1166,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) } else if(st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE){ // ttxt stsd contains display flags, justification, background // color, fonts, and default styles, so fake an atom to read it - MOVAtom fake_atom = { .size = size - (url_ftell(pb) - start_pos) }; + MOVAtom fake_atom = { .size = size - (avio_tell(pb) - start_pos) }; if (format != AV_RL32("mp4s")) // mp4s contains a regular esds atom mov_read_glbl(c, pb, fake_atom); st->codec->codec_id= id; @@ -1174,10 +1174,10 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) st->codec->height = sc->height; } else { /* other codec type, just skip (rtp, mp4s, tmcd ...) */ - avio_seek(pb, size - (url_ftell(pb) - start_pos), SEEK_CUR); + avio_seek(pb, size - (avio_tell(pb) - start_pos), SEEK_CUR); } /* this will read extra atoms at the end (wave, alac, damr, avcC, SMI ...) */ - a.size = size - (url_ftell(pb) - start_pos); + a.size = size - (avio_tell(pb) - start_pos); if (a.size > 8) { if (mov_read_default(c, pb, a) < 0) return -1; @@ -2299,7 +2299,7 @@ static void mov_read_chapters(AVFormatContext *s) st->discard = AVDISCARD_ALL; sc = st->priv_data; - cur_pos = url_ftell(sc->pb); + cur_pos = avio_tell(sc->pb); for (i = 0; i < st->nb_index_entries; i++) { AVIndexEntry *sample = &st->index_entries[i]; @@ -2364,7 +2364,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) av_log(s, AV_LOG_ERROR, "moov atom not found\n"); return -1; } - av_dlog(mov->fc, "on_parse_exit_offset=%lld\n", url_ftell(pb)); + av_dlog(mov->fc, "on_parse_exit_offset=%lld\n", avio_tell(pb)); if (!url_is_streamed(pb) && mov->chapter_track > 0) mov_read_chapters(s); @@ -2413,7 +2413,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 || url_feof(s->pb)) return AVERROR_EOF; - av_dlog(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb)); + av_dlog(s, "read fragments, offset 0x%llx\n", avio_tell(s->pb)); goto retry; } sc = st->priv_data; |