1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-07-24 18:19:50 +02:00
parent 3c6e220a8c
commit 7923aa0fba

View File

@ -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) {