[FFmpeg-cvslog] r17076 - in trunk: ffmpeg.c libavformat/utils.c

superdump subversion
Sun Feb 8 23:03:55 CET 2009


Author: superdump
Date: Sun Feb  8 23:03:54 2009
New Revision: 17076

Log:
Add the ability to set the timestamp to the current time by specifying 'now'
as the time

Patch by Francesco Cosoleto ( cosoleto gmail com )

Modified:
   trunk/ffmpeg.c
   trunk/libavformat/utils.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Sun Feb  8 22:42:06 2009	(r17075)
+++ trunk/ffmpeg.c	Sun Feb  8 23:03:54 2009	(r17076)
@@ -3769,7 +3769,7 @@ static const OptionDef options[] = {
     { "itsoffset", OPT_FUNC2 | HAS_ARG, {(void*)opt_input_ts_offset}, "set the input ts offset", "time_off" },
     { "itsscale", HAS_ARG, {(void*)opt_input_ts_scale}, "set the input ts scale", "stream:scale" },
     { "title", HAS_ARG | OPT_STRING, {(void*)&str_title}, "set the title", "string" },
-    { "timestamp", OPT_FUNC2 | HAS_ARG, {(void*)&opt_rec_timestamp}, "set the timestamp", "time" },
+    { "timestamp", OPT_FUNC2 | HAS_ARG, {(void*)&opt_rec_timestamp}, "set the timestamp ('now' to set the current time)", "time" },
     { "author", HAS_ARG | OPT_STRING, {(void*)&str_author}, "set the author", "string" },
     { "copyright", HAS_ARG | OPT_STRING, {(void*)&str_copyright}, "set the copyright", "string" },
     { "comment", HAS_ARG | OPT_STRING, {(void*)&str_comment}, "set the comment", "string" },

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Sun Feb  8 22:42:06 2009	(r17075)
+++ trunk/libavformat/utils.c	Sun Feb  8 23:03:54 2009	(r17076)
@@ -2908,6 +2908,9 @@ int64_t parse_date(const char *datestr, 
     p = datestr;
     q = NULL;
     if (!duration) {
+        if (!strncasecmp(datestr, "now", len))
+            return (int64_t) now * 1000000;
+
         /* parse the year-month-day part */
         for (i = 0; i < FF_ARRAY_ELEMS(date_fmt); i++) {
             q = small_strptime(p, date_fmt[i], &dt);




More information about the ffmpeg-cvslog mailing list