[FFmpeg-cvslog] mxfdec: Parse TemporalOffsets

Tomas Härdin git at videolan.org
Thu Dec 8 21:36:27 CET 2011


ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Thu Dec  8 11:39:59 2011 +0100| [7560c264958877e790935aba77b50163157162ab] | committer: Tomas Härdin

mxfdec: Parse TemporalOffsets

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7560c264958877e790935aba77b50163157162ab
---

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

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 2057f3b..4343c4e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -150,6 +150,7 @@ typedef struct {
     int *slice;
     int *element_delta;
     int nb_delta_entries;
+    int8_t *temporal_offset_entries;
     int *flag_entries;
     uint64_t *stream_offset_entries;
     uint32_t **slice_offset_entries;
@@ -701,7 +702,8 @@ static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *seg
     segment->nb_index_entries = avio_rb32(pb);
     length = avio_rb32(pb);
 
-    if (!(segment->flag_entries          = av_calloc(segment->nb_index_entries, sizeof(*segment->flag_entries))) ||
+    if (!(segment->temporal_offset_entries=av_calloc(segment->nb_index_entries, sizeof(*segment->temporal_offset_entries))) ||
+        !(segment->flag_entries          = av_calloc(segment->nb_index_entries, sizeof(*segment->flag_entries))) ||
         !(segment->stream_offset_entries = av_calloc(segment->nb_index_entries, sizeof(*segment->stream_offset_entries))))
         return AVERROR(ENOMEM);
 
@@ -710,7 +712,8 @@ static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *seg
         return AVERROR(ENOMEM);
 
     for (i = 0; i < segment->nb_index_entries; i++) {
-        avio_rb16(pb);  /* TemporalOffset and KeyFrameOffset */
+        segment->temporal_offset_entries[i] = avio_r8(pb);
+        avio_r8(pb);                                        /* KeyFrameOffset */
         segment->flag_entries[i] = avio_r8(pb);
         segment->stream_offset_entries[i] = avio_rb64(pb);
         if (segment->slice_count) {
@@ -1582,6 +1585,7 @@ static int mxf_read_close(AVFormatContext *s)
                 av_freep(&seg->slice_offset_entries[j]);
             av_freep(&seg->slice);
             av_freep(&seg->element_delta);
+            av_freep(&seg->temporal_offset_entries);
             av_freep(&seg->flag_entries);
             av_freep(&seg->stream_offset_entries);
             av_freep(&seg->slice_offset_entries);



More information about the ffmpeg-cvslog mailing list