diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-07-07 11:25:03 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-07-12 15:30:10 +0200 |
commit | 5f847bf61dca1fd1a2f65a2f56c9a99d1cb716ab (patch) | |
tree | c6efb65d184923aa8b5e2eaa87336a59bdec4a1f /libavformat/mxfenc.c | |
parent | b12c2592525c3d8e12265a3d923a945d6f699a5b (diff) | |
download | ffmpeg-5f847bf61dca1fd1a2f65a2f56c9a99d1cb716ab.tar.gz |
lavf: deprecate AVFormatContext.timestamp
It's replaced by 'creation_time' metadata tag.
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r-- | libavformat/mxfenc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 16fa0dadd1..d7cc5c1c67 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1407,6 +1407,8 @@ static int mxf_write_header(AVFormatContext *s) int i; uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0}; const int *samples_per_frame = NULL; + AVDictionaryEntry *t; + int64_t timestamp = 0; if (!s->nb_streams) return -1; @@ -1512,8 +1514,18 @@ static int mxf_write_header(AVFormatContext *s) sc->order = AV_RB32(sc->track_essence_element_key+12); } +#if FF_API_TIMESTAMP if (s->timestamp) - mxf->timestamp = mxf_parse_timestamp(s->timestamp); + timestamp = s->timestamp; + else +#endif + if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) { + struct tm time = {0}; + strptime(t->value, "%Y - %m - %dT%T", &time); + timestamp = mktime(&time); + } + if (timestamp) + mxf->timestamp = mxf_parse_timestamp(timestamp); mxf->duration = -1; mxf->timecode_track = av_mallocz(sizeof(*mxf->timecode_track)); |