From patchwork Wed Oct 2 13:04:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: rzumer@tebako.net X-Patchwork-Id: 15461 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 E4CE1447F20 for ; Wed, 2 Oct 2019 16:05:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BE7EB6880EB; Wed, 2 Oct 2019 16:05:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFCD3687ED3 for ; Wed, 2 Oct 2019 16:05:03 +0300 (EEST) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id CD66F16005F for ; Wed, 2 Oct 2019 15:05:02 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 46jxF90c1yz6tm7 for ; Wed, 2 Oct 2019 15:05:00 +0200 (CEST) From: =?UTF-8?q?Rapha=C3=ABl=20Zumer?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 2 Oct 2019 09:04:59 -0400 Message-Id: <20191002130459.4695-1-rzumer@tebako.net> X-Mailer: git-send-email 2.23.0 In-Reply-To: <9b932332-8c5c-6a52-5fcd-1e82fe5f99a0@gmail.com> References: <9b932332-8c5c-6a52-5fcd-1e82fe5f99a0@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/ivfenc: Change the length fields to 32 bits 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" There is no change in the encoded bitstream, but this ensures that the written field length is consistent with the reference implementation. Unused bytes are zeroed out for backwards compatibility. Signed-off-by: Raphaƫl Zumer --- libavformat/ivfenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c index ae461a872b..eb70421c44 100644 --- a/libavformat/ivfenc.c +++ b/libavformat/ivfenc.c @@ -84,7 +84,8 @@ static int ivf_write_trailer(AVFormatContext *s) avio_seek(pb, 24, SEEK_SET); // overwrite the "length" field (duration) - avio_wl64(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1)); + avio_wl32(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1)); + avio_wl32(pb, 0); // zero out unused bytes avio_seek(pb, end, SEEK_SET); }