From patchwork Wed Apr 3 06:47:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 12600 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 CCD4B4481E9 for ; Wed, 3 Apr 2019 09:48:21 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9E10668ADD8; Wed, 3 Apr 2019 09:48:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx1.mailbox.org (mx1.mailbox.org [80.241.60.212]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4683468ADB0 for ; Wed, 3 Apr 2019 09:48:14 +0300 (EEST) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 315164C0A8 for ; Wed, 3 Apr 2019 08:48:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id kQ2WpUGBd8C9 for ; Wed, 3 Apr 2019 08:47:59 +0200 (CEST) To: ffmpeg-devel@ffmpeg.org References: <1554110666.2022.2.camel@acc.umu.se> <7e91a6d8-4aae-51d7-45fc-e6ec18b1eab8@gyani.pro> From: Gyan Message-ID: Date: Wed, 3 Apr 2019 12:17:55 +0530 MIME-Version: 1.0 In-Reply-To: <7e91a6d8-4aae-51d7-45fc-e6ec18b1eab8@gyani.pro> Content-Language: en-US Subject: Re: [FFmpeg-devel] [PATCH] lavf/movenc: fix tmcd writing for non-MP4/MOV modes 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" On 02-04-2019 05:31 PM, Gyan wrote: > > > On 01-04-2019 02:54 PM, Tomas Härdin wrote: >> sön 2019-03-31 klockan 00:11 +0530 skrev Gyan: >>> Regression since, I believe, 42cb050a05 >> Sounds like there should be a test case to go along with it so it >> doesn't re-regress in the future :) > > Turns out there's already a test. But the command is ineffective :) > > Will fix it. Test corrected. Gyan From 8206aeb2e6e23c56f6b4324017efa812f499c3da Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Sun, 31 Mar 2019 00:00:50 +0530 Subject: [PATCH v2] lavf/movenc: fix tmcd writing for non-MP4/MOV modes write_tmcd allows tmcd track to be created with any mode but in mov_write_header, index for first tmcd track is only set for modes MP4 or MOV, causing a crash if tmcd creation is attempted with other modes. --- libavformat/movenc.c | 2 +- tests/fate/lavf-container.mak | 2 +- tests/ref/lavf/ismv | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7f5dcd703e..c67f909608 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6381,7 +6381,7 @@ static int mov_write_header(AVFormatContext *s) nb_tracks++; } - if (mov->mode == MODE_MOV || mov->mode == MODE_MP4) + if (mov->nb_meta_tmcd) tmcd_track = nb_tracks; for (i = 0; i < s->nb_streams; i++) { diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak index a531914aad..22387d04d8 100644 --- a/tests/fate/lavf-container.mak +++ b/tests/fate/lavf-container.mak @@ -34,7 +34,7 @@ fate-lavf-flm: CMD = lavf_container "" "-pix_fmt rgba" fate-lavf-gxf: CMD = lavf_container "-ar 48000" "-r 25 -s pal -ac 1 -threads 1" fate-lavf-gxf_pal: CMD = lavf_container_timecode_nodrop "-ar 48000 -r 25 -s pal -ac 1 -threads 1 -f gxf" fate-lavf-gxf_ntsc: CMD = lavf_container_timecode_drop "-ar 48000 -s ntsc -ac 1 -threads 1 -f gxf" -fate-lavf-ismv: CMD = lavf_container_timecode "-an -c:v mpeg4 -threads 1" +fate-lavf-ismv: CMD = lavf_container_timecode "-an -write_tmcd 1 -c:v mpeg4 -threads 1" fate-lavf-mkv: CMD = lavf_container "" "-c:a mp2 -c:v mpeg4 -ar 44100 -threads 1" fate-lavf-mkv_attachment: CMD = lavf_container_attach "-c:a mp2 -c:v mpeg4 -threads 1 -f matroska" fate-lavf-mov: CMD = lavf_container_timecode "-movflags +faststart -c:a pcm_alaw -c:v mpeg4 -threads 1" diff --git a/tests/ref/lavf/ismv b/tests/ref/lavf/ismv index 96dc8c1c9d..865a6913cf 100644 --- a/tests/ref/lavf/ismv +++ b/tests/ref/lavf/ismv @@ -1,8 +1,8 @@ -96053075a3f60d271131fe2d0765c267 *tests/data/lavf/lavf.ismv -312542 tests/data/lavf/lavf.ismv +bd88b50defa57766619c092ea89f25a6 *tests/data/lavf/lavf.ismv +313165 tests/data/lavf/lavf.ismv tests/data/lavf/lavf.ismv CRC=0x9d9a638a -7022701b4c693bc4ffe1e9f96dd82a02 *tests/data/lavf/lavf.ismv -321448 tests/data/lavf/lavf.ismv +805a2557bf952c84835f3c10b6893e15 *tests/data/lavf/lavf.ismv +322071 tests/data/lavf/lavf.ismv tests/data/lavf/lavf.ismv CRC=0xe8130120 96053075a3f60d271131fe2d0765c267 *tests/data/lavf/lavf.ismv 312542 tests/data/lavf/lavf.ismv