aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-05 12:57:24 +0200
committerJames Almer <jamrial@gmail.com>2015-05-14 19:52:02 -0300
commitd9390b9d649c8c5e6facf0be522afadb92132032 (patch)
treedaf372288d5fefa0dbf04fac3c153aeb59626445
parent5a8b43285baa744d5450a4a37d98bcfb500c18fe (diff)
downloadffmpeg-d9390b9d649c8c5e6facf0be522afadb92132032.tar.gz
avformat/matroskaenc: Use avoid_negative_ts_use_pts if no stream writes dts
This reduces the number of cases where timestamps need to be shifted Fixes Ticket4487 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 9d4fdfe24c731d1880797dee65365154b41c1dea)
-rw-r--r--libavformat/matroskaenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 22af9ef9b9..ec856515fa 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -940,6 +940,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
// if there is no mkv-specific codec ID, use VFW mode
put_ebml_string(pb, MATROSKA_ID_CODECID, "V_MS/VFW/FOURCC");
mkv->tracks[i].write_dts = 1;
+ s->internal->avoid_negative_ts_use_pts = 0;
}
subinfo = start_ebml_master(pb, MATROSKA_ID_TRACKVIDEO, 0);
@@ -1316,8 +1317,10 @@ static int mkv_write_header(AVFormatContext *s)
else
mkv->mode = MODE_MATROSKAv2;
- if (s->avoid_negative_ts < 0)
+ if (s->avoid_negative_ts < 0) {
s->avoid_negative_ts = 1;
+ s->internal->avoid_negative_ts_use_pts = 1;
+ }
if (mkv->mode != MODE_WEBM ||
av_dict_get(s->metadata, "stereo_mode", NULL, 0) ||