[FFmpeg-cvslog] avformat/options_table: add named constants for avoid_negative_ts

Michael Niedermayer git at videolan.org
Mon Feb 24 20:28:10 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Feb 22 22:44:37 2014 +0100| [a908de7f49449beb66a9d70a0a06f8b59e564d69] | committer: Michael Niedermayer

avformat/options_table: add named constants for avoid_negative_ts

Idea-by: ubitux
Reviewed-by: Timothy Gu <timothygu99 at gmail.com>
Reviewed-by: Clément Bœsch <u at pkh.me>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a908de7f49449beb66a9d70a0a06f8b59e564d69
---

 doc/formats.texi            |   20 ++++++++++++++------
 libavformat/options_table.h |    6 +++++-
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/doc/formats.texi b/doc/formats.texi
index bdd144e..027510e 100644
--- a/doc/formats.texi
+++ b/doc/formats.texi
@@ -125,18 +125,26 @@ Consider things that a sane encoder should not do as an error.
 Use wallclock as timestamps.
 
 @item avoid_negative_ts @var{integer} (@emph{output})
-Shift timestamps to make them non-negative. A value of 1 enables shifting,
-a value of 0 disables it, the default value of -1 enables shifting
-when required by the target format.
+
+Possible values:
+ at table @samp
+ at item make_non_negative
+Shift timestamps to make them non-negative.
+Also note that this affects only leading negative timestamps, and not
+non-monotonic negative timestamps.
+ at item make_zero
+Shift timestamps so that the first timestamp is 0.
+ at item auto (default)
+Enables shifting when required by the target format.
+ at item disabled
+Disables shifting of timestamp.
+ at end table
 
 When shifting is enabled, all output timestamps are shifted by the
 same amount. Audio, video, and subtitles desynching and relative
 timestamp differences are preserved compared to how they would have
 been without shifting.
 
-Also note that this affects only leading negative timestamps, and not
-non-monotonic negative timestamps.
-
 @item skip_initial_bytes @var{integer} (@emph{input})
 Set number of bytes to skip before reading header and frames if set to 1.
 Default is 0.
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 2e08682..c80309c 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -73,7 +73,11 @@ static const AVOption avformat_options[] = {
 {"compliant",  "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT }, INT_MIN, INT_MAX, D, "err_detect"},
 {"aggressive", "consider things that a sane encoder shouldn't do as an error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, D, "err_detect"},
 {"use_wallclock_as_timestamps", "use wallclock as timestamps", OFFSET(use_wallclock_as_timestamps), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D},
-{"avoid_negative_ts", "shift timestamps so they start at 0. 1 enable if negative ts, 2 enable, 0 disables, default of -1 enables when required by target format.", OFFSET(avoid_negative_ts), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, E},
+{"avoid_negative_ts", "shift timestamps so they start at 0", OFFSET(avoid_negative_ts), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, E, "avoid_negative_ts"},
+{"auto",                "enabled when required by target format",    0, AV_OPT_TYPE_CONST, {.i64 = -1 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
+{"disabled",            "do not change timestamps",                  0, AV_OPT_TYPE_CONST, {.i64 =  0 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
+{"make_zero",           "shift timestamps so they start at 0",       0, AV_OPT_TYPE_CONST, {.i64 =  2 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
+{"make_non_negative",   "shift timestamps so they are non negative", 0, AV_OPT_TYPE_CONST, {.i64 =  1 }, INT_MIN, INT_MAX, E, "avoid_negative_ts"},
 {"skip_initial_bytes", "set number of bytes to skip before reading header and frames", OFFSET(skip_initial_bytes), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D},
 {"correct_ts_overflow", "correct single timestamp overflows", OFFSET(correct_ts_overflow), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, D},
 {"flush_packets", "enable flushing of the I/O context after each packet", OFFSET(flush_packets), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E},



More information about the ffmpeg-cvslog mailing list