From patchwork Fri Apr 19 23:40:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 12825 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 6E5D1448AA7 for ; Sat, 20 Apr 2019 02:48:26 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 455BA68AA99; Sat, 20 Apr 2019 02:48:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 14BAA68AA98 for ; Sat, 20 Apr 2019 02:48:20 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id j9so8502193wrn.6 for ; Fri, 19 Apr 2019 16:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0RBfNH2cGZ92luy03SSfM7yPtNnkCQYjaaHkT4pvUlM=; b=DGChuvqnUC4UyN2av/h7H7G6P8QGQKTHMi0Q9FSyjNZvN3ILMSP0TnRU+Fbn59nvzG OhkffgV4Vvgg7WR0CEAxMa+Ko7do/SFKkq1n9+9rlnnCjMSx2RS9QklyOU0j22zEPVPU dQY+uRACBIFRTojyAID4v+Cw7u2E4phdXehkFDk0eKfPh30DrmF86uDt/nEBQYAujauX OA7rbLarhOcvMNWO+eyoCP4xrmZzTh0xwMg2vWMZGYtDeg4xhiUAFA1pUThKQ8rm4RMe jSamEqtrulf76wXvncB/ZkSjlkQLs1FeMAbFgewPK2VYO4Jb38MrAMwUmaS8UKpcB8Am nSgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0RBfNH2cGZ92luy03SSfM7yPtNnkCQYjaaHkT4pvUlM=; b=r7jQCvFCDFZo7U/NBzk/OTv7TkJnSgV9QdQkpIr8Cw7qdmN29W7ejV9zBa/t5tByfD njFEl068uF69KbRbA/ZGnw46P+Ut8bpfXqFrBzdv8whYOyN8X6BqA092sJqFp+tY0pts /zRNU8gCRuZ8Jv1vXkwy9WjjVSy+GNVvurG8UsJUcCrPuA8jTrpzh78G8jsTZ6aQN82Q Lzqr5c85hPW8p8N681PtAq+9XwzTjhs/KDXxYAbkxOjXAkyyOWMQlf6aIDM/XDdN/H+H Xkdb0x6xSh6DyXSP3QTxPoUGm4rH0I1Dwzc1GxcZtXnvIi2/1a8joTTkh2zAhl1Fjzb4 I4qw== X-Gm-Message-State: APjAAAVkcr2nL7sp7oOfHfhFWl1xbGvMENwKZ5vW6VnZle20SDveBfkL vNPgPQVmE5JL6DXG5VKYzP6VwT4HqPo= X-Google-Smtp-Source: APXvYqy/1npgYkalMOt6I/9uVp6T8X2CM/ECFx4A9il1AyCw73xxAUYJIry0bxXyV+ottTeINucy6A== X-Received: by 2002:adf:dec4:: with SMTP id i4mr4285219wrn.318.1555717321217; Fri, 19 Apr 2019 16:42:01 -0700 (PDT) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.gmail.com with ESMTPSA id t14sm6002395wmi.16.2019.04.19.16.41.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2019 16:42:00 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Apr 2019 01:40:56 +0200 Message-Id: <20190419234110.32980-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190402133305.3328-1-andreas.rheinhardt@googlemail.com> References: <20190402133305.3328-1-andreas.rheinhardt@googlemail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/15] avformat/matroskaenc: Fix relative timestamp check X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- The only difference between this version and the earlier version is the authorship information. My earlier emails were munged and in order to make the committer's life easier, I'll resend the whole patchset. I would appreciate reviews and comments. libavformat/matroskaenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 1c98c0dceb..c006cbf35c 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);