changeset 4478:548d31443ddc libavformat

fix slice offset computation
author bcoudurier
date Fri, 13 Feb 2009 19:04:30 +0000
parents 1b6a4571f7bf
children 4e18c9ac9b10
files mxfenc.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mxfenc.c	Fri Feb 13 09:39:04 2009 +0000
+++ b/mxfenc.c	Fri Feb 13 19:04:30 2009 +0000
@@ -1723,8 +1723,9 @@
 
         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);