From patchwork Tue Aug 13 02:47:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 14467 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 79EC2449ADB for ; Tue, 13 Aug 2019 05:54:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 613AC68ABB7; Tue, 13 Aug 2019 05:54:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 455BD68AB0A for ; Tue, 13 Aug 2019 05:54:03 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id m125so71909wmm.3 for ; Mon, 12 Aug 2019 19:54:03 -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=k+T2lZY3PD5Oxbp3FlnHkHhHnIGL2OxTY8KuDupZBTU=; b=iLbJ05k/EY829nu5br2cRyRr8HUnm0eAzkB7u+jiWK2bvIQSemwto0nocYe4aIM/st y8w5/uihsdUuZKSsva1r5DdEfYTKn/Qg9Ot8sRT6fUClryGPsxr9S62e9UA9PG/WaItP Lw7tQYqNbaSb8ozZK8KRhF7fBvB92ZHe9p0fa9Hi7b50D/NzBoDriRlngjanLlnbqn48 yK4CdQC9vOrx3VljLT9L+P/mD8bOWssyLlSABrD5m9jG3G14vjUrNbRJlmy7KbTVHu+w TM8upDp3lMpW0j3mEPoaGwRY6MJIZmNEq3zHiag6OONWtSt5/1dPd3sV9aS4W+fnLMXj riAA== 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=k+T2lZY3PD5Oxbp3FlnHkHhHnIGL2OxTY8KuDupZBTU=; b=jr3lp+no0WXl1tzJfMWzTQAS/Zo1ELNPuomeiWkgh3/4oRu4uNYPQXD2MgpoTqQ3Zu BkqYZ9ujg77+HyEtrDFj3CB4EU2RfVtUo7zMvZbO8a+amGJaTDbDDBuWgkXuJbLXIQLS 5HBTIK79VulF0ykKZqYtrpb3r7jxpRL9bmM9R2R9QQ5IJyAZCdy3Zq7VfsaAOfCBbaTL bu8mPigu9IYbW0qniEh4CtvdOUKJ79GQFGwlJWMvfrCdGqSSOflvtHNHmuX5J6wEVf1j mQUeFCuOjB8Vw6e7nPDdgV8Q8/+vn+f6h4LixIV/+1o7QNBQtzribnHvPxKgWVohFppK awHQ== X-Gm-Message-State: APjAAAWh/fENOOc/Xb4EuV2Qlq6LIaEPcrimkRMqJdf311i0Dhou3Cbn 4rIIjFvt+wUhFtf6NclFOQVQe8UX X-Google-Smtp-Source: APXvYqyx081U9J9o3cMUReXnhF+b0pmsWTmAtTmO+UV1Yc+T6GIGsDifXjfbMNPuQtUadH/HImOnFA== X-Received: by 2002:a05:600c:21d3:: with SMTP id x19mr147491wmj.45.1565664533606; Mon, 12 Aug 2019 19:48:53 -0700 (PDT) Received: from localhost.localdomain (ipbcc06ceb.dynamic.kabel-deutschland.de. [188.192.108.235]) by smtp.gmail.com with ESMTPSA id k13sm25020613wro.97.2019.08.12.19.48.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 19:48:53 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Aug 2019 04:47:26 +0200 Message-Id: <20190813024726.6596-13-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190813024726.6596-1-andreas.rheinhardt@gmail.com> References: <20190813024726.6596-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/13] avformat/mux: Remove pointless timestamp backups 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" write_packet currently saves the original timestamps of the packet it got and restores them in case writing fails. This is unnecessary as none of write_packet's callers make any use of these timestamps at all. So remove this and add a general comment to the function that timestamps may be modified; also remove a long outdated comment about side data. Signed-off-by: Andreas Rheinhardt --- libavformat/mux.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index 2dc7fc2dcb..8f617d4011 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -663,8 +663,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif /** - * Make timestamps non negative, move side data from payload to internal struct, call muxer, and restore - * sidedata. + * Make timestamps non negative and call muxer; the original pts/dts are not kept. * * FIXME: this function should NEVER get undefined pts/dts beside when the * AVFMT_NOTIMESTAMPS is set. @@ -674,10 +673,6 @@ FF_ENABLE_DEPRECATION_WARNINGS static int write_packet(AVFormatContext *s, AVPacket *pkt) { int ret; - int64_t pts_backup, dts_backup; - - pts_backup = pkt->pts; - dts_backup = pkt->dts; // If the timestamp offsetting below is adjusted, adjust // ff_interleaved_peek similarly. @@ -753,11 +748,6 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) ret = s->pb->error; } - if (ret < 0) { - pkt->pts = pts_backup; - pkt->dts = dts_backup; - } - return ret; }