[Ffmpeg-devel] [PATCH] MXF duration improvements
Reimar Döffinger
Reimar.Doeffinger
Wed Jul 26 20:52:50 CEST 2006
Hello,
the attached patch sets the default duration (when no such info is found
in the file) to AV_NOPTS_VALUE instead of 0.
It also sets start_time to 0 by default. I'm not 100% sure if that is
correct, but otherwise AVFormatContext.duration does not get set
and MPlayer can not display the total time.
Gretings,
Reimar D?ffinger
-------------- next part --------------
Index: libavformat/mxf.c
===================================================================
--- libavformat/mxf.c (revision 5829)
+++ libavformat/mxf.c (working copy)
@@ -215,7 +215,7 @@
ByteIOContext *pb = &mxf->fc->pb;
uint8_t sequence_uid[16];
uint8_t data_definition[16];
- uint64_t duration = 0;
+ uint64_t duration = AV_NOPTS_VALUE;
int bytes_read = 0;
int i;
@@ -241,6 +241,7 @@
for (i = 0; i < mxf->tracks_count; i++)
if (!memcmp(sequence_uid, mxf->tracks[i].sequence_uid, 16)) {
+ mxf->tracks[i].stream->start_time = 0;
mxf->tracks[i].stream->duration = duration;
if (data_definition[11] == 0x02 && data_definition[12] == 0x01)
mxf->tracks[i].stream->codec->codec_type = CODEC_TYPE_VIDEO;
More information about the ffmpeg-devel
mailing list