[PATCH 5/8] extend MXFIndexTableSegment

Maksym Veremeyenko verem at m1.tv
Sat Jul 3 13:01:01 CEST 2010


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

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 5a3e52b..329285e 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, AVIOContext *pb, int tag, int size
 
 static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int size, UID uid)
 {
+    MXFIndexTableSegment *segment = arg;
+
     switch(tag) {
-    case 0x3F05: av_dlog(NULL, "EditUnitByteCount %d\n", avio_rb32(pb)); break;
-    case 0x3F06: av_dlog(NULL, "IndexSID %d\n", avio_rb32(pb)); break;
-    case 0x3F07: av_dlog(NULL, "BodySID %d\n", avio_rb32(pb)); break;
-    case 0x3F0B: av_dlog(NULL, "IndexEditRate %d/%d\n", avio_rb32(pb), avio_rb32(pb)); break;
-    case 0x3F0C: av_dlog(NULL, "IndexStartPosition %lld\n", avio_rb64(pb)); break;
-    case 0x3F0D: av_dlog(NULL, "IndexDuration %lld\n", avio_rb64(pb)); break;
+    case 0x3F05:
+        segment->edit_unit_byte_count = avio_rb32(pb);
+        av_dlog(NULL, "EditUnitByteCount %d\n", segment->edit_unit_byte_count);
+        break;
+    case 0x3F06:
+        segment->index_sid = avio_rb32(pb);
+        av_dlog(NULL, "IndexSID %d\n", segment->index_sid);
+        break;
+    case 0x3F07:
+        segment->body_sid = avio_rb32(pb);
+        av_dlog(NULL, "BodySID %d\n", segment->body_sid);
+        break;
+    case 0x3F0B:
+        segment->index_edit_rate.num = avio_rb32(pb);
+        segment->index_edit_rate.den = avio_rb32(pb);
+        av_dlog(NULL, "IndexEditRate %d/%d\n", segment->index_edit_rate.num,
+                segment->index_edit_rate.num);
+        break;
+    case 0x3F0C:
+        segment->index_start_position = avio_rb64(pb);
+        av_dlog(NULL, "IndexStartPosition %lld\n", segment->index_start_position);
+        break;
+    case 0x3F0D:
+        segment->index_duration = avio_rb64(pb);
+        av_dlog(NULL, "IndexDuration %lld\n", segment->index_duration);
+        break;
     }
     return 0;
 }
-- 
1.7.4


--------------080409060609020706050401
Content-Type: text/x-patch;
 name="0006-extend-MXFTrack-with-wrapping-field.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0006-extend-MXFTrack-with-wrapping-field.patch"



More information about the libav-devel mailing list