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>
This commit is contained in:
@@ -942,6 +942,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
|
|||||||
// if there is no mkv-specific codec ID, use VFW mode
|
// if there is no mkv-specific codec ID, use VFW mode
|
||||||
put_ebml_string(pb, MATROSKA_ID_CODECID, "V_MS/VFW/FOURCC");
|
put_ebml_string(pb, MATROSKA_ID_CODECID, "V_MS/VFW/FOURCC");
|
||||||
mkv->tracks[i].write_dts = 1;
|
mkv->tracks[i].write_dts = 1;
|
||||||
|
s->internal->avoid_negative_ts_use_pts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
subinfo = start_ebml_master(pb, MATROSKA_ID_TRACKVIDEO, 0);
|
subinfo = start_ebml_master(pb, MATROSKA_ID_TRACKVIDEO, 0);
|
||||||
@@ -1322,8 +1323,10 @@ static int mkv_write_header(AVFormatContext *s)
|
|||||||
else
|
else
|
||||||
mkv->mode = MODE_MATROSKAv2;
|
mkv->mode = MODE_MATROSKAv2;
|
||||||
|
|
||||||
if (s->avoid_negative_ts < 0)
|
if (s->avoid_negative_ts < 0) {
|
||||||
s->avoid_negative_ts = 1;
|
s->avoid_negative_ts = 1;
|
||||||
|
s->internal->avoid_negative_ts_use_pts = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (mkv->mode != MODE_WEBM ||
|
if (mkv->mode != MODE_WEBM ||
|
||||||
av_dict_get(s->metadata, "stereo_mode", NULL, 0) ||
|
av_dict_get(s->metadata, "stereo_mode", NULL, 0) ||
|
||||||
|
Reference in New Issue
Block a user