From ab91e84d2b537a4b33cbf1399f052c37ef3b475f Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Fri, 13 Feb 2009 19:04:30 +0000 Subject: [PATCH] fix slice offset computation Originally committed as revision 17212 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mxfenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index ef350c4708..56d6da3475 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1723,8 +1723,9 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt) mxf->edit_units_count++; } else if (st->index == 1) { - mxf->index_entries[mxf->edit_units_count-1].slice_offset = - url_ftell(pb) - mxf->index_entries[mxf->edit_units_count-1].offset; + uint64_t pos = url_ftell(pb); + mxf->index_entries[mxf->edit_units_count-1].slice_offset = pos + + klv_fill_size(pos) - mxf->index_entries[mxf->edit_units_count-1].offset; } mxf_write_klv_fill(s);