On Wed, 4 Jul 2018, Baptiste Coudurier wrote:

---
libavformat/mxf.c    |  1 +
libavformat/mxfdec.c |  3 +++
libavformat/mxfenc.c | 41 +++++++++++++++++++++++++++++++++++++----
libavformat/utils.c  |  6 +++++-
4 files changed, 46 insertions(+), 5 deletions(-)

diff --git a/libavformat/mxf.c b/libavformat/mxf.c
index 8376a2b9bf..451cbcfb2c 100644
--- a/libavformat/mxf.c
+++ b/libavformat/mxf.c
@@ -28,6 +28,7 @@
const MXFCodecUL ff_mxf_data_definition_uls[] = {
    { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x01,0x00,0x00,0x00 
}, 13, AVMEDIA_TYPE_VIDEO },
    { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x02,0x00,0x00,0x00 
}, 13, AVMEDIA_TYPE_AUDIO },
+    { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x03,0x00,0x00,0x00 
}, 13, AVMEDIA_TYPE_DATA },
    { { 
0x80,0x7D,0x00,0x60,0x08,0x14,0x3E,0x6F,0x6F,0x3C,0x8C,0xE1,0x6C,0xEF,0x11,0xD2 
}, 16, AVMEDIA_TYPE_VIDEO }, /* LegacyPicture Avid Media Composer MXF */
    { { 
0x80,0x7D,0x00,0x60,0x08,0x14,0x3E,0x6F,0x78,0xE1,0xEB,0xE1,0x6C,0xEF,0x11,0xD2 
}, 16, AVMEDIA_TYPE_AUDIO }, /* LegacySound Avid Media Composer MXF */
    { { 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 
},  0,  AVMEDIA_TYPE_DATA },
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 8c417aea26..3f443bbbc9 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3291,6 +3291,9 @@ static int mxf_set_pts(MXFContext *mxf, AVStream *st, 
AVPacket *pkt, int64_t nex
        int ret = mxf_set_audio_pts(mxf, par, pkt);
        if (ret < 0)
            return ret;
+    } else {
+        pkt->dts = pkt->pts = mxf->current_edit_unit;
+        pkt->duration = 1;
    }
    return 0;
}

Sorry, my clip wrapping patches I just committed conflicted with your work here, you should use something like this for this hunk:

--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3298,6 +3298,8 @@ static int mxf_set_pts(MXFContext *mxf, AVStream *st, 
AVPacket *pkt)
         if (ret < 0)
             return ret;
     } else if (track) {
+        pkt->dts = pkt->pts = track->sample_count;
+        pkt->duration = 1;
         track->sample_count++;
     }
     return 0;

Thanks,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to