aboutsummaryrefslogtreecommitdiffstats
path: root/avconv.c
diff options
context:
space:
mode:
authorAndrey Utkin <andrey.krieger.utkin@gmail.com>2012-02-05 16:49:14 +0200
committerAnton Khirnov <anton@khirnov.net>2012-02-12 17:15:41 +0100
commitc22e2ec9d1ffe7fd59be2198520b9a746de62e91 (patch)
treea73ed164e470a3fc0222bbceaead26ec5a510c39 /avconv.c
parent3dffa1b46c6a03c2f58d88da2b83f1a467575a72 (diff)
downloadffmpeg-c22e2ec9d1ffe7fd59be2198520b9a746de62e91.tar.gz
avconv: set AVFormatContext.duration from '-t'
Set output files duration to recording_time option, if given. Rationale: to save duration into metadata for file that is written to non-seekable output, for formats like FLV (with metadata at beginning). Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 418e1fde8b..92ffd0fd0d 100644
--- a/avconv.c
+++ b/avconv.c
@@ -3955,6 +3955,8 @@ static void opt_output_file(void *optctx, const char *filename)
output_files[nb_output_files - 1].ctx = oc;
output_files[nb_output_files - 1].ost_index = nb_output_streams - oc->nb_streams;
output_files[nb_output_files - 1].recording_time = o->recording_time;
+ if (o->recording_time != INT64_MAX)
+ oc->duration = o->recording_time;
output_files[nb_output_files - 1].start_time = o->start_time;
output_files[nb_output_files - 1].limit_filesize = o->limit_filesize;
av_dict_copy(&output_files[nb_output_files - 1].opts, format_opts, 0);