X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmxfenc.c;h=cd13f897873c7478000fb660aab74a1d4ef4c982;hb=259fef86bb91784f31a7e43e0d6d6a2a1d86f41c;hp=35c67f78138dce77e1e8f8faf629ecb2cd507fbb;hpb=f97d2d210553d64dccdc07da1eb9923fb46c5fcc;p=ffmpeg diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 35c67f78138..cd13f897873 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1013,7 +1013,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke int stored_height = (st->codec->height+15)/16*16; int display_height; int f1, f2; - unsigned desc_size = size+8+8+8+8+8+8+8+5+16+sc->interlaced*4+12+20+5; + unsigned desc_size = size+8+8+8+8+8+8+8+5+16+4+12+20+5; if (sc->interlaced && sc->field_dominance) desc_size += 5; if (sc->signal_standard) @@ -1081,12 +1081,12 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke f1 *= 2; } - mxf_write_local_tag(pb, 12+sc->interlaced*4, 0x320D); - avio_wb32(pb, sc->interlaced ? 2 : 1); + + mxf_write_local_tag(pb, 16, 0x320D); + avio_wb32(pb, 2); avio_wb32(pb, 4); avio_wb32(pb, f1); - if (sc->interlaced) - avio_wb32(pb, f2); + avio_wb32(pb, f2); mxf_write_local_tag(pb, 8, 0x320E); avio_wb32(pb, sc->aspect_ratio.num); @@ -2041,7 +2041,6 @@ static int mxf_write_header(AVFormatContext *s) int i, ret; uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0}; const MXFSamplesPerFrame *spf = NULL; - AVDictionaryEntry *t; int64_t timestamp = 0; if (!s->nb_streams) @@ -2212,9 +2211,7 @@ static int mxf_write_header(AVFormatContext *s) sc->order = AV_RB32(sc->track_essence_element_key+12); } - if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) - timestamp = ff_iso8601_to_unix_time(t->value); - if (timestamp) + if (ff_parse_creation_time_metadata(s, ×tamp, 1) > 0) mxf->timestamp = mxf_parse_timestamp(timestamp); mxf->duration = -1;