From patchwork Fri Nov 18 03:35:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Gregan X-Patchwork-Id: 1470 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp1146267vsb; Thu, 17 Nov 2016 19:35:24 -0800 (PST) X-Received: by 10.28.43.198 with SMTP id r189mr19385610wmr.67.1479440124841; Thu, 17 Nov 2016 19:35:24 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id yk9si5634983wjb.266.2016.11.17.19.35.24; Thu, 17 Nov 2016 19:35:24 -0800 (PST) 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=@flim.org; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0749A689F76; Fri, 18 Nov 2016 05:35:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from flim.org (flim.org [65.99.223.158]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 78EA6689F2B for ; Fri, 18 Nov 2016 05:35:14 +0200 (EET) Received: from localhost (unknown [121.98.51.0]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by flim.org (Postfix) with ESMTPSA id 8C3A314190 for ; Fri, 18 Nov 2016 03:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flim.org; s=default; t=1479440113; bh=1EqcgHoNUH13r0fWXTWxoACwBsmBue3HYpzs8RON0XE=; h=Date:From:To:Subject:From; b=GzCmsWFMCYY873/S2wWsW+xRQ7R4S6fbvuEqv8FHHrTzR/G8vwqj443r6Zs/Bsec0 nNOW2P4hbwQRBCDzloQxi8whFM14i/eFZVPZ735i2sFqik1o9IkC1/89uzrCuP9bEF 8YszDGz70i8glyBanFJoU7e4H7ijm9lfEXeEqqVI= Date: Fri, 18 Nov 2016 16:35:10 +1300 From: Matthew Gregan To: FFmpeg development discussions and patches Message-ID: <20161118033510.GI8366@brak.lan> Mail-Followup-To: FFmpeg development discussions and patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [FFmpeg-devel] [PATCH] Restrict experimental VP9 support to MODE_MP4. 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" Without this, it's possible to mux VP9 into MOV without passing -strict -2. This tightens the check to restrict VP9 to MODE_MP4 only. Based on the discussion with James Almer on the experimental FLAC in MP4 muxing patch. From 47f74ca9269d2bddccd9d273d6739798f9bfd0b7 Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Fri, 18 Nov 2016 16:29:42 +1300 Subject: [PATCH] Restrict experimental VP9 support to MODE_MP4. Signed-off-by: Matthew Gregan --- libavformat/movenc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 5452ff7..a114d71 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5714,8 +5714,11 @@ static int mov_init(AVFormatContext *s) pix_fmt == AV_PIX_FMT_MONOWHITE || pix_fmt == AV_PIX_FMT_MONOBLACK; } - if (track->mode == MODE_MP4 && - track->par->codec_id == AV_CODEC_ID_VP9) { + if (track->par->codec_id == AV_CODEC_ID_VP9) { + if (track->mode != MODE_MP4) { + av_log(s, AV_LOG_ERROR, "VP9 only supported in MP4.\n"); + return AVERROR(EINVAL); + } if (s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { av_log(s, AV_LOG_ERROR, "VP9 in MP4 support is experimental, add " -- 2.10.1