Commit a72a0dce authored by superdump's avatar superdump

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

as the time

Patch by Francesco Cosoleto ( cosoleto gmail com )


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17076 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 97eb308a
...@@ -3769,7 +3769,7 @@ static const OptionDef options[] = { ...@@ -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" }, { "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" }, { "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" }, { "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" }, { "author", HAS_ARG | OPT_STRING, {(void*)&str_author}, "set the author", "string" },
{ "copyright", HAS_ARG | OPT_STRING, {(void*)&str_copyright}, "set the copyright", "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" }, { "comment", HAS_ARG | OPT_STRING, {(void*)&str_comment}, "set the comment", "string" },
......
...@@ -2908,6 +2908,9 @@ int64_t parse_date(const char *datestr, int duration) ...@@ -2908,6 +2908,9 @@ int64_t parse_date(const char *datestr, int duration)
p = datestr; p = datestr;
q = NULL; q = NULL;
if (!duration) { if (!duration) {
if (!strncasecmp(datestr, "now", len))
return (int64_t) now * 1000000;
/* parse the year-month-day part */ /* parse the year-month-day part */
for (i = 0; i < FF_ARRAY_ELEMS(date_fmt); i++) { for (i = 0; i < FF_ARRAY_ELEMS(date_fmt); i++) {
q = small_strptime(p, date_fmt[i], &dt); q = small_strptime(p, date_fmt[i], &dt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment