Commit 7923aa0f authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/matroskaenc: Start new cluster if relative timestamp could not otherwise be stored

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3c6e220a
......@@ -1709,6 +1709,14 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_
}
ts += mkv->tracks[pkt->stream_index].ts_offset;
if (mkv->cluster_pos != -1) {
int64_t cluster_time = ts - mkv->cluster_pts + mkv->tracks[pkt->stream_index].ts_offset;
if ((int16_t)cluster_time != cluster_time) {
av_log(s, AV_LOG_DEBUG, "Starting new cluster due to timestamp\n");
mkv_start_new_cluster(s, pkt);
}
}
if (!s->pb->seekable) {
if (!mkv->dyn_bc) {
if ((ret = avio_open_dyn_buf(&mkv->dyn_bc)) < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment