diff mbox

[FFmpeg-devel] Restrict experimental VP9 support to MODE_MP4.

Message ID 20161118033510.GI8366@brak.lan
State New
Headers show

Commit Message

Matthew Gregan Nov. 18, 2016, 3:35 a.m. UTC
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.

Comments

James Almer Nov. 21, 2016, 7:08 p.m. UTC | #1
On 11/18/2016 12:35 AM, Matthew Gregan wrote:
> 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.
> 
> 
> 0001-Restrict-experimental-VP9-support-to-MODE_MP4.patch
> 
> 
> From 47f74ca9269d2bddccd9d273d6739798f9bfd0b7 Mon Sep 17 00:00:00 2001
> From: Matthew Gregan <kinetik@flim.org>
> Date: Fri, 18 Nov 2016 16:29:42 +1300
> Subject: [PATCH] Restrict experimental VP9 support to MODE_MP4.
> 
> Signed-off-by: Matthew Gregan <kinetik@flim.org>
> ---
>  libavformat/movenc.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 

Pushed, thanks.
diff mbox

Patch

From 47f74ca9269d2bddccd9d273d6739798f9bfd0b7 Mon Sep 17 00:00:00 2001
From: Matthew Gregan <kinetik@flim.org>
Date: Fri, 18 Nov 2016 16:29:42 +1300
Subject: [PATCH] Restrict experimental VP9 support to MODE_MP4.

Signed-off-by: Matthew Gregan <kinetik@flim.org>
---
 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