diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-26 13:52:51 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-26 16:51:47 +0400 |
commit | eba33396f007dc373678adea6c1a4b1a50373263 (patch) | |
tree | 382ac0d8e1569344058cf0f0c3b259405514d0b4 /libavformat/mux.c | |
parent | e5891a23372d542c81a8ee7e15844ed444ffc962 (diff) |
avformat/mux: set avoid_negative_ts based on flags if not overridden by user or muxer
This changes the default to avoid negative timestamps.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r-- | libavformat/mux.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index 4781a3e8de..eba4ec3c5a 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -398,6 +398,13 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options) if ((ret = init_pts(s)) < 0) return ret; + if (s->avoid_negative_ts < 0) { + if (s->oformat->flags & (AVFMT_TS_NEGATIVE | AVFMT_NOTIMESTAMPS)) { + s->avoid_negative_ts = 0; + } else + s->avoid_negative_ts = 1; + } + return 0; } |