summaryrefslogtreecommitdiff
path: root/libavformat/gxfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-13 00:42:11 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-13 00:42:11 +0200
commitbb258fb995a42112d1fe14f53ec599b2cd19b707 (patch)
treed7152f06fcff2c66509c57a5dd906ca225069ae1 /libavformat/gxfenc.c
parent896e59758a11ff645879098b5ebca2e753731b4e (diff)
parent2cb6dec61c8e6676105de628ba20a5b3d162976e (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: doc: Improve references to external URLs. h264: move decode_mb_skip() from h264.h to h.264_mvpred.h ffplay: skip return value of avcodec_decode_video2 / avcodec_decode_subtitle2 dnxhdenc: Replace a forward declaration by the proper #include. h264: move h264_mvpred.h include. pix_fmt: Fix number of bits per component in yuv444p9be lavf: deprecate AVFormatContext.timestamp ffmpeg: merge input_files_ts_scale into InputStream. ffmpeg: don't abuse a global for passing sample format from input to output ffmpeg: don't abuse a global for passing channel layout from input to output ffmpeg: factor common code from new_a/v/s/d_stream to new_output_stream() matroskaenc: make SSA default subtitle codec. oggdec: prevent heap corruption. Conflicts: doc/developer.texi doc/faq.texi doc/general.texi ffmpeg.c ffplay.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/gxfenc.c')
-rw-r--r--libavformat/gxfenc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index da25ddcc2a..62ee4eb751 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -394,6 +394,20 @@ static int gxf_write_umf_material_description(AVFormatContext *s)
GXFContext *gxf = s->priv_data;
AVIOContext *pb = s->pb;
int timecode_base = gxf->time_base.den == 60000 ? 60 : 50;
+ int64_t timestamp = 0;
+ AVDictionaryEntry *t;
+
+#if FF_API_TIMESTAMP
+ if (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);
+ }
+
// XXX drop frame
uint32_t timecode =
@@ -409,8 +423,8 @@ static int gxf_write_umf_material_description(AVFormatContext *s)
avio_wl32(pb, gxf->nb_fields); /* mark out */
avio_wl32(pb, 0); /* timecode mark in */
avio_wl32(pb, timecode); /* timecode mark out */
- avio_wl64(pb, s->timestamp); /* modification time */
- avio_wl64(pb, s->timestamp); /* creation time */
+ avio_wl64(pb, timestamp); /* modification time */
+ avio_wl64(pb, timestamp); /* creation time */
avio_wl16(pb, 0); /* reserved */
avio_wl16(pb, 0); /* reserved */
avio_wl16(pb, gxf->audio_tracks);