diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-16 22:00:49 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-19 12:24:50 +0100 |
commit | 48ff1ba68762a869d4d8ea66b4e045779fb82555 (patch) | |
tree | 65b13e20447d98790cdb4f7bb09924d7454f5a37 | |
parent | 989e20690057801b41838592cf27d42fb3cb2c3c (diff) | |
download | ffmpeg-48ff1ba68762a869d4d8ea66b4e045779fb82555.tar.gz |
avformat/matroskaenc: Avoid repeated avio_tell()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavformat/matroskaenc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 5facdb139b..c8a8e31030 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2503,7 +2503,7 @@ static int mkv_write_block(void *logctx, MatroskaMuxContext *mkv, AVIOContext *pb, const AVCodecParameters *par, mkv_track *track, const AVPacket *pkt, int keyframe, int64_t ts, uint64_t duration, - int force_blockgroup) + int force_blockgroup, int64_t relative_packet_pos) { uint8_t *side_data; size_t side_data_size; @@ -2529,7 +2529,7 @@ static int mkv_write_block(void *logctx, MatroskaMuxContext *mkv, "Writing block of size %d with pts %" PRId64 ", dts %" PRId64 ", " "duration %" PRId64 " at relative offset %" PRId64 " in cluster " "at offset %" PRId64 ". TrackNumber %u, keyframe %d\n", - pkt->size, pkt->pts, pkt->dts, pkt->duration, avio_tell(pb), + pkt->size, pkt->pts, pkt->dts, pkt->duration, relative_packet_pos, mkv->cluster_pos, track_number, keyframe != 0); side_data = av_packet_get_side_data(pkt, @@ -2737,7 +2737,8 @@ static int mkv_write_packet_internal(AVFormatContext *s, const AVPacket *pkt) * so we force it even for packets without duration. */ ret = mkv_write_block(s, mkv, pb, par, track, pkt, keyframe, ts, write_duration, - par->codec_id == AV_CODEC_ID_WEBVTT); + par->codec_id == AV_CODEC_ID_WEBVTT, + relative_packet_pos); if (ret < 0) return ret; if (keyframe && IS_SEEKABLE(s->pb, mkv) && |