summaryrefslogtreecommitdiff
path: root/libavformat/dvenc.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/dvenc.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/dvenc.c')
-rw-r--r--libavformat/dvenc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 0cbe7a5484..3b2a8eb711 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -43,7 +43,7 @@ struct DVMuxContext {
AVStream *ast[2]; /* stereo audio streams */
AVFifoBuffer *audio_data[2]; /* FIFO for storing excessive amounts of PCM */
int frames; /* current frame number */
- time_t start_time; /* recording start time */
+ int64_t start_time; /* recording start time */
int has_audio; /* frame under contruction has audio */
int has_video; /* frame under contruction has video */
uint8_t frame_buf[DV_MAX_FRAME_SIZE]; /* frame under contruction */
@@ -290,6 +290,7 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
{
DVMuxContext *c = s->priv_data;
AVStream *vst = NULL;
+ AVDictionaryEntry *t;
int i;
/* we support at most 1 video and 2 audio streams */
@@ -337,7 +338,16 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
c->frames = 0;
c->has_audio = 0;
c->has_video = 0;
- c->start_time = (time_t)s->timestamp;
+#if FF_API_TIMESTAMP
+ if (s->timestamp)
+ c->start_time = 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);
+ c->start_time = mktime(&time);
+ }
for (i=0; i < c->n_ast; i++) {
if (c->ast[i] && !(c->audio_data[i]=av_fifo_alloc(100*AVCODEC_MAX_AUDIO_FRAME_SIZE))) {