Browse Source

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4
Michael Niedermayer 11 years ago
parent
commit
7923aa0fba
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavformat/matroskaenc.c

+ 8
- 0
libavformat/matroskaenc.c 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) {


Loading…
Cancel
Save