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:
parent
3c6e220a8c
commit
7923aa0fba
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user