This is the same logic as is invoked on AVFMT_TS_NEGATIVE,
but which can be enabled manually, or can be enabled
in muxers which only need it in certain conditions.
Also allow using the same mechanism to force streams to start
at 0.
Signed-off-by: Martin Storsjö <martin@martin.st>
pull/94/head
Michael Niedermayer13 years agocommitted byMartin Storsjö
{"max_ts_probe","maximum number of packets to read while waiting for the first timestamp",OFFSET(max_ts_probe),AV_OPT_TYPE_INT,{.i64=50},0,INT_MAX,D},
{"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=AVFMT_AVOID_NEG_TS_AUTO},INT_MIN,INT_MAX,E,"avoid_negative_ts"},
{"make_non_negative","shift timestamps so they are non negative",0,AV_OPT_TYPE_CONST,{.i64=AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE},INT_MIN,INT_MAX,E,"avoid_negative_ts"},
{"make_zero","shift timestamps so they start at 0",0,AV_OPT_TYPE_CONST,{.i64=AVFMT_AVOID_NEG_TS_MAKE_ZERO},INT_MIN,INT_MAX,E,"avoid_negative_ts"},