summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2018-03-21 12:59:11 -0700
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2018-10-12 12:27:43 -0700
commit84e8a87ca082f5a882e83fcb34a970f8b720cc25 (patch)
tree5a3073494cdaf4d2b909957e4cd4215f6161b36b /libavformat
parentea55a11ced5ef73bc7173ae2d3e268e26b351350 (diff)
downloadffmpeg-84e8a87ca082f5a882e83fcb34a970f8b720cc25.tar.gz
avformat/mxfenc: update body partition with footer offset
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxfenc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index a62d2a3e94..b34ab8ba47 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1938,7 +1938,7 @@ static int mxf_write_partition(AVFormatContext *s, int bodysid,
else
avio_write(pb, body_partition_key, 16);
- klv_encode_ber_length(pb, 88 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
+ klv_encode_ber4_length(pb, 88 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
// write partition value
avio_wb16(pb, 1); // majorVersion
@@ -2905,7 +2905,7 @@ static int mxf_write_footer(AVFormatContext *s)
{
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
- int err = 0;
+ int i, err = 0;
if (!mxf->header_written ||
(s->oformat == &ff_mxf_opatom_muxer && !mxf->body_partition_offset)) {
@@ -2949,6 +2949,11 @@ static int mxf_write_footer(AVFormatContext *s)
if ((err = mxf_write_partition(s, 0, 0, header_closed_partition_key, 1)) < 0)
goto end;
}
+ // update footer partition offset
+ for (i = 0; i < mxf->body_partitions_count; i++) {
+ avio_seek(pb, mxf->body_partition_offset[i]+44, SEEK_SET);
+ avio_wb64(pb, mxf->footer_partition_offset);
+ }
}
end: