From patchwork Wed Feb 6 00:33:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niki Bowe X-Patchwork-Id: 11979 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 9F2B7449084 for ; Wed, 6 Feb 2019 02:33:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 74BFA689B51; Wed, 6 Feb 2019 02:33:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A3DE268AACC for ; Wed, 6 Feb 2019 02:33:29 +0200 (EET) Received: by mail-vs1-f54.google.com with SMTP id z3so3392359vsf.7 for ; Tue, 05 Feb 2019 16:33:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=I5eJwG7+gyemEoFdgF960o+YFSQ7G/Rw/63BT+truAM=; b=Au43WkiY/pfFHCLBEZqqXexBbx/0Gg+DOGnV3y6uN3U64NOPbnunGQYeX7lAUXuQ5I eCJAijPEZ60WLxhKGcBI/Fng6EtN5oAhtOe95t2hxufkIq5oBV6joY6K/XEi4RHHKkx4 DAIKrAiHE3fzGeQA6e7wXT47dIUefqc/ntfpqCx1LWQOQ+HNdeBDVIbVU8xukByhMBzw xbqdCjeIVXNaYZirMmKqV2fosV8SNsVAraobQTERmG+HQ3LsANNkFFk023BoG9fJ+vB4 t8uaWWUFtw92w1k54jMXOBk1uYvMswWgXddMEq+KyViTFl5tHyQb3PBAq5Ap3N7fu/my sIMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=I5eJwG7+gyemEoFdgF960o+YFSQ7G/Rw/63BT+truAM=; b=KHsGkBqkHfc3ZiPkq1cKIaipOUKk1j7C8Mg78iOpcGxKoUxMmAv8uh/DhoUpUpzCdc q8ShNWVcp43LUtPlBkX8EXm+1i1BTkENSRd6C+FM3KxwK7Dbb0DL62AFlbmAKl5/4+vh 6y2ncEh7b2mAHvSCAU95Pqh1EdSiSTFYdPsg2YJcu4OLCL5aMob4WHIHf4RogS1EoQj5 O3Hifcpwko9ZSxABG8Ssn5MbNeCyc+OFz/Qd7AMhB4jksZrHW+oF7uMswupNHpYz9Mkd fj3YC0mOJEpvfgbrjxJzJNmPoFk2WRlUt3XEAp3Vu3ra7QoIn1RlUKBqMMDFAYerX2dD 6A+g== X-Gm-Message-State: AHQUAuYEEXpBCkqcqc3FPa4XJwyRmDLzr4KiDoYeQaEbdcBowsHSf9IM OGCDy3QAWTsCs60IwwNDYRzlKNwiU9GCmuQSznRYGs7eGis= X-Google-Smtp-Source: AHgI3IbiXxX5Psge8NFxtutckD5or4lnUSI1qboJ0NHtrqt7PEWQxDZBCtacd+Wfyq636JR67CLSchbveFAGNnjR884= X-Received: by 2002:a67:4a96:: with SMTP id e22mr3184163vsg.92.1549413207339; Tue, 05 Feb 2019 16:33:27 -0800 (PST) MIME-Version: 1.0 References: <20190205021135.221078-1-nbowe@google.com> In-Reply-To: From: Niki Bowe Date: Tue, 5 Feb 2019 16:33:15 -0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] avformat/movenc: Fix muxing EAC3 with delay_moov 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" Hi Carl. You are of course correct. Attached replacement patch. On Mon, Feb 4, 2019 at 6:24 PM Carl Eugen Hoyos wrote: > 2019-02-05 3:11 GMT+01:00, Nikolas Bowe : > > > + if (mov->tracks[i].eac3_priv) > > + av_freep(&mov->tracks[i].eac3_priv); > > I would have expected that the if() is unneeded, no? > > Carl Eugen > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > From ebb9c55a6f11d70e16dca4dd3d05ae36fb5737b6 Mon Sep 17 00:00:00 2001 From: Nikolas Bowe Date: Mon, 4 Feb 2019 17:31:08 -0800 Subject: [PATCH] avformat/movenc: Fix muxing EAC3 with delay_moov You are of course correct When using delay_moov mov_write_moov_tag gets called multiple times. Therefore we need to keep eac3_priv around for subsequent calls. Signed-off-by: Nikolas Bowe --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 65be2968a1..00ad318943 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -579,7 +579,6 @@ static int mov_write_eac3_tag(AVIOContext *pb, MOVTrack *track) end: av_packet_unref(&info->pkt); - av_freep(&track->eac3_priv); return size; } @@ -5956,6 +5955,7 @@ static void mov_free(AVFormatContext *s) av_freep(&mov->tracks[i].vos_data); ff_mov_cenc_free(&mov->tracks[i].cenc); + av_freep(&mov->tracks[i].eac3_priv); } av_freep(&mov->tracks); -- 2.20.1.611.gfbb209baf1-goog