[FFmpeg-devel] [PATCH 6/7] lavf/mxfdec: fix stream time base for j2k codec with interlaced layout

Matthieu Bouron matthieu.bouron at gmail.com
Thu Mar 28 15:41:50 CET 2013


Since two packets are required to decoded a frame, we need to divide by
a factor of 2 the stream time base so output ptses are correct.
---
 libavformat/mxfdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 7b7ac90..171d32e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1553,6 +1553,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
             case AV_CODEC_ID_JPEG2000:
                 if (descriptor->frame_layout == SegmentedFrame ||
                     descriptor->frame_layout == SeparateFields) {
+                    st->codec->time_base = st->time_base;
+                    st->time_base = (AVRational) { st->time_base.num, st->time_base.den * 2};
                     st->codec->extradata_size = 2;
                     st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
                     if (!st->codec->extradata)
-- 
1.8.2



More information about the ffmpeg-devel mailing list