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:
@@ -1709,6 +1709,14 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_
|
|||||||
}
|
}
|
||||||
ts += mkv->tracks[pkt->stream_index].ts_offset;
|
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 (!s->pb->seekable) {
|
||||||
if (!mkv->dyn_bc) {
|
if (!mkv->dyn_bc) {
|
||||||
if ((ret = avio_open_dyn_buf(&mkv->dyn_bc)) < 0) {
|
if ((ret = avio_open_dyn_buf(&mkv->dyn_bc)) < 0) {
|
||||||
|
Reference in New Issue
Block a user