[PATCH 5/6] extend MXFIndexTableSegment

Maksym Veremeyenko verem
Sun Sep 19 11:22:55 CEST 2010


---
 libavformat/mxfdec.c |   40 ++++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index fb80c21..d510e77 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -107,6 +107,12 @@ typedef struct {
 typedef struct {
     UID uid;
     enum MXFMetadataSetType type;
+    int edit_unit_byte_count;
+    int index_sid;
+    int body_sid;
+    AVRational index_edit_rate;
+    uint64_t index_start_position;
+    uint64_t index_duration;
 } MXFIndexTableSegment;
 
 typedef struct {
@@ -524,13 +530,35 @@ static int mxf_read_source_package(void *arg, ByteIOContext *pb, int tag, int si
 
 static int mxf_read_index_table_segment(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
 {
+    MXFIndexTableSegment *segment = (MXFIndexTableSegment *)arg;
+
     switch(tag) {
-    case 0x3F05: dprintf(NULL, "EditUnitByteCount %d\n", get_be32(pb)); break;
-    case 0x3F06: dprintf(NULL, "IndexSID %d\n", get_be32(pb)); break;
-    case 0x3F07: dprintf(NULL, "BodySID %d\n", get_be32(pb)); break;
-    case 0x3F0B: dprintf(NULL, "IndexEditRate %d/%d\n", get_be32(pb), get_be32(pb)); break;
-    case 0x3F0C: dprintf(NULL, "IndexStartPosition %lld\n", get_be64(pb)); break;
-    case 0x3F0D: dprintf(NULL, "IndexDuration %lld\n", get_be64(pb)); break;
+    case 0x3F05:
+        segment->edit_unit_byte_count = get_be32(pb);
+        dprintf(NULL, "EditUnitByteCount %d\n", segment->edit_unit_byte_count);
+        break;
+    case 0x3F06:
+        segment->index_sid = get_be32(pb);
+        dprintf(NULL, "IndexSID %d\n", segment->index_sid);
+        break;
+    case 0x3F07:
+        segment->body_sid = get_be32(pb);
+        dprintf(NULL, "BodySID %d\n", segment->body_sid);
+        break;
+    case 0x3F0B:
+        segment->index_edit_rate.num = get_be32(pb);
+        segment->index_edit_rate.den = get_be32(pb);
+        dprintf(NULL, "IndexEditRate %d/%d\n", segment->index_edit_rate.num,
+                segment->index_edit_rate.num);
+        break;
+    case 0x3F0C:
+        segment->index_start_position = get_be64(pb);
+        dprintf(NULL, "IndexStartPosition %lld\n", segment->index_start_position);
+        break;
+    case 0x3F0D:
+        segment->index_duration = get_be64(pb);
+        dprintf(NULL, "IndexDuration %lld\n", segment->index_duration);
+        break;
     }
     return 0;
 }
-- 
1.7.2.2


--------------000903070506090506070305
Content-Type: text/x-patch;
 name="0006-clip-wrapped-support-added-for-single-track-file.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="0006-clip-wrapped-support-added-for-single-track-file.patch"




More information about the ffmpeg-devel mailing list