From patchwork Fri Oct 7 13:46:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hendrik Leppkes X-Patchwork-Id: 905 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp1419849vsd; Fri, 7 Oct 2016 06:46:33 -0700 (PDT) X-Received: by 10.194.150.206 with SMTP id uk14mr17081096wjb.139.1475847992907; Fri, 07 Oct 2016 06:46:32 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n3si3153583wmn.104.2016.10.07.06.46.31; Fri, 07 Oct 2016 06:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 91190689DF8; Fri, 7 Oct 2016 16:46:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 364B0689A81 for ; Fri, 7 Oct 2016 16:46:07 +0300 (EEST) Received: by mail-wm0-f66.google.com with SMTP id 123so3071083wmb.3 for ; Fri, 07 Oct 2016 06:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=Vdf7xy0jz2K1njK4reMv23XbASfqsJbQjGcHnej/WNA=; b=a9L2qBJ6LYwSv7eNETdLTUwzmSS51O3+x2mfmCR2+jAb/eA9pWZyQ8EKEqOywmlTd7 9SdOJgFrL6/S1JQaNYHWs2JARtUIQGCE8nwOPhRQsCqA1CvbTPrFh035CSnOKrqQuSeO zDdTmIaT8UbTmaMfXpFA7a4B+r9B/aX1FVkADFQDTOKmTQ7UIukTw7an83z19PJaszO3 16rfemOITrp+ndP4sngbMdkHdF77mZ74xdh0cAABEP5YQAnswtCk6TGc04lkn6j/VjYT UDexKfvm42yOAdGmBYnrOxm2ufN3Wu6V2nDO6mt23mEIFyZvao4TFVaINdreutOeyTb7 4hZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=Vdf7xy0jz2K1njK4reMv23XbASfqsJbQjGcHnej/WNA=; b=LCQuH6X5f11jMKP/GysjUAm1DLdkVyh4KGmhu2/YDx3B6869MCRCLSFp6xE1yf73WE 9XF74kotFFe96m6TRq7ah6kiK2R/u4eIM2NwHCu90TbsgbnYbi39YuCgV9L+WH/KiNtk obcUK7NstzdMRhPET3eKwIE0vt0+AzOZp+CuqO4QPl148yeC+i9daWiMmSM55Kfl1Yj/ JPldTKGGHOxFN6iyKSI/rd+eHEOIgsr1S9Zd01yBIV1/WSOBnENo7sP1bhnqZYSU+uvE YiEVYnXR2adOf3SLQKZ6J4qsGa4Hb+udKNoFKzMbU2zCPn8f2d6qQZZVWk/Axq/23GcT CgiA== X-Gm-Message-State: AA6/9Rm+dc5eEmCmtK2ot8p+X6zwHEdE3zPLZ3vBd5bxjCP4sViUinzbXBdGU8GE8ovW9Q== X-Received: by 10.194.55.9 with SMTP id n9mr16278212wjp.208.1475847982521; Fri, 07 Oct 2016 06:46:22 -0700 (PDT) Received: from localhost ([93.193.140.167]) by smtp.gmail.com with ESMTPSA id h3sm19834782wjp.45.2016.10.07.06.46.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2016 06:46:21 -0700 (PDT) From: Hendrik Leppkes To: ffmpeg-devel@ffmpeg.org Date: Fri, 7 Oct 2016 15:46:14 +0200 Message-Id: <20161007134614.2116-1-h.leppkes@gmail.com> X-Mailer: git-send-email 2.10.0.windows.1 Subject: [FFmpeg-devel] [PATCH] ffmpeg: explicitly write headers for files with no streams 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Recent changes to ffmpeg.c tied output file init to stream init, which broke stream-less files, specifically ffmetadata output. --- ffmpeg.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index 454e193..b3e23ef 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -3460,6 +3460,16 @@ static int transcode_init(void) } } + /* write headers for files with no streams */ + for (i = 0; i < nb_output_files; i++) { + oc = output_files[i]->ctx; + if (oc->oformat->flags & AVFMT_NOSTREAMS) { + ret = check_init_output_file(output_files[i], i); + if (ret < 0) + goto dump_format; + } + } + dump_format: /* dump the stream mapping */ av_log(NULL, AV_LOG_INFO, "Stream mapping:\n");