summaryrefslogtreecommitdiffstats
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-04-20 01:40:56 +0200
committerJames Almer <jamrial@gmail.com>2019-05-08 13:02:28 -0300
commit4ebeab15b037a21f195696cef1f7522daf42f3ee (patch)
treed354751beee7139545f6702e44f8ecc7c6e2d9c0 /libavformat/matroskaenc.c
parentc636dc9819ebab1a84237cc017a6a3d35ebc9cdc (diff)
downloadffmpeg-streaming-4ebeab15b037a21f195696cef1f7522daf42f3ee.zip
ffmpeg-streaming-4ebeab15b037a21f195696cef1f7522daf42f3ee.tar.gz
avformat/matroskaenc: Fix relative timestamp check
At this point, ts already includes the ts_offset so that the relative time written with the cluster is already given by ts - mkv->cluster_pts. It is this number that needs to fit into an int16_t. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 1c98c0d..c006cbf 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -2404,7 +2404,7 @@ 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;
+ int64_t cluster_time = ts - mkv->cluster_pts;
if ((int16_t)cluster_time != cluster_time) {
av_log(s, AV_LOG_WARNING, "Starting new cluster due to timestamp\n");
mkv_start_new_cluster(s, pkt);
OpenPOWER on IntegriCloud