changeset 4430:d6fe53c5c8d2 libavformat

correctly set multi track operational pattern
author bcoudurier
date Tue, 10 Feb 2009 04:53:41 +0000
parents 7ed870203bfe
children 723d05287ae9
files mxfenc.c
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mxfenc.c	Tue Feb 10 02:27:26 2009 +0000
+++ b/mxfenc.c	Tue Feb 10 04:53:41 2009 +0000
@@ -381,8 +381,14 @@
     mxf_write_local_tag(pb, 16, 0x3B03);
     mxf_write_uuid(pb, ContentStorage, 0);
 
+    // operational pattern
     mxf_write_local_tag(pb, 16, 0x3B09);
-    put_buffer(pb, op1a_ul, 16);
+    if (s->nb_streams > 1) {
+        put_buffer(pb, op1a_ul, 14);
+        put_be16(pb, 0x0900); // multi track
+    } else {
+        put_buffer(pb, op1a_ul, 16);
+    }
 
     // write essence_container_refs
     mxf_write_local_tag(pb, 8 + 16 * mxf->essence_container_count, 0x3B0A);
@@ -1000,7 +1006,14 @@
     put_be64(pb, 0); // bodyOffset
 
     put_be32(pb, bodysid); // bodySID
-    put_buffer(pb, op1a_ul, 16); // operational pattern
+
+    // operational pattern
+    if (s->nb_streams > 1) {
+        put_buffer(pb, op1a_ul, 14);
+        put_be16(pb, 0x0900); // multi track
+    } else {
+        put_buffer(pb, op1a_ul, 16);
+    }
 
     // essence container
     mxf_write_essence_container_refs(s);