summaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-07-07 11:25:03 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-12 15:30:10 +0200
commit5f847bf61dca1fd1a2f65a2f56c9a99d1cb716ab (patch)
treec6efb65d184923aa8b5e2eaa87336a59bdec4a1f /libavformat/mxfenc.c
parentb12c2592525c3d8e12265a3d923a945d6f699a5b (diff)
lavf: deprecate AVFormatContext.timestamp
It's replaced by 'creation_time' metadata tag.
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c14
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));