[PATCH 5/6] extend MXFIndexTableSegment

storyparts storyparts
Wed Apr 14 12:11:58 CEST 2010


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

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index d78d258..9428182 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -106,6 +106,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 {
@@ -503,12 +509,32 @@ static int mxf_read_source_package(MXFPackage *package, ByteIOContext *pb, int t
 static int mxf_read_index_table_segment(MXFIndexTableSegment *segment, ByteIOContext *pb, int tag)
 {
     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);
+        av_log(NULL, AV_LOG_DEBUG, "EditUnitByteCount %d\n", segment->edit_unit_byte_count);
+        break;
+    case 0x3F06:
+        segment->index_sid = get_be32(pb);
+        av_log(NULL, AV_LOG_DEBUG, "IndexSID %d\n", segment->index_sid);
+        break;
+    case 0x3F07:
+        segment->body_sid = get_be32(pb);
+        av_log(NULL, AV_LOG_DEBUG, "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);
+        av_log(NULL, AV_LOG_DEBUG, "IndexEditRate %d/%d\n", segment->index_edit_rate.num,
+               segment->index_edit_rate.num);
+        break;
+    case 0x3F0C:
+        segment->index_start_position = get_be64(pb);
+        av_log(NULL, AV_LOG_DEBUG, "IndexStartPosition %lld\n", segment->index_start_position);
+        break;
+    case 0x3F0D:
+        segment->index_duration = get_be64(pb);
+        av_log(NULL, AV_LOG_DEBUG, "IndexDuration %lld\n", segment->index_duration);
+        break;
     }
     return 0;
 }
-- 
1.6.6.1


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




More information about the ffmpeg-devel mailing list