添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by ffaux.localdomain (Postfix) with ESMTP id 0DA91448C54
	for <[email protected]>;
	Fri, 20 Sep 2019 01:32:25 +0300 (EEST)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7794689E0F;
	Fri, 20 Sep 2019 01:32:24 +0300 (EEST)
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from mail-io1-f51.google.com (mail-io1-f51.google.com
	[209.85.166.51])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D713B689BEA
	for <[email protected]>; Fri, 20 Sep 2019 01:32:18 +0300 (EEST)
Received: by mail-io1-f51.google.com with SMTP id n197so11618412iod.9
	for <[email protected]>; Thu, 19 Sep 2019 15:32:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=oElsc0Y5jE2/oIA88EJXj8+tc8t+K5E9DD7HXzCs56o=;
	b=HsADQlrYlqnvvX7vVsL6F0eLJHlHGxFrbacg13W5kFBRiktutLYlhEYvTRyQqgHnSk
	2kfJnjM6M/YkIVZqpDObHUfDkCcJ8W0ZYYeV7LawCfZkbInox6xd3fAFfRBoeRfolQ60
	qrztXedBOSQqTfZdVAMDZMY4+MaEeLzSND/P3VIjACokhB3NZiKR2lKTNV8dBmlCwsEP
	ZjkvzwRIXBKqMXM9N2WeJPaLpTiIa5L5fFTJ0SY0xL6kKX6GF/vqnLbJFKDqcnTUIlwc
	J1pr7UDp4PJOsAAkboEHgCx6ZwyUNWGRVsTAzKY6HrK6DiKgBr7dujrr6FzBnXz6SCOa
	N0bQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=oElsc0Y5jE2/oIA88EJXj8+tc8t+K5E9DD7HXzCs56o=;
	b=fVxb+5r5JV74smfcBYHeL/4GTMgXGXstI8e0cTQWjqVSuTjrwYdWd/sIxzdzn6qzyA
	eC8rxCTEC9KpQUuHD/fUvjoStELIRgtIG+Ugk56adGpin2Syaa8IJLnI+WTtOPB3swLp
	g6T5uMCb47t4OKvXFnJF5OtNr+rFImfMalEiVxqtBbes0iJv13Rkjg9IITSiMueiD/7x
	xjXzMeg9RUPtizoNjOSNa8W++0toILobtYD9bb2hTwFWJari8Bm9x63QiXoex4LJZMFD
	UM8B5TsIIMPOCQUVDRLWV/3YnDE7SsWwgKV0+5fcO1oAOgZB9hPm1RERfebF/pQN9Rg6
	lQRw==
X-Gm-Message-State: APjAAAWleFW3grRczAFGOKSkbb1jBOQTh/UkhxrvytCpRBupTkpeksXy
	6m1vIhbTxpsxUzHItrlECYHhxPpScby32uqztKNRrQ==
X-Google-Smtp-Source: APXvYqz/j2/FEZdbljV3e20x0riVBkp6AxROmxznXnImwr8sRe3/2FDcASsG7D3stlIsfoHg4jXRWKlPkKRwckhDD+Q=
X-Received: by 2002:a6b:c8cf:: with SMTP id
	y198mr5472055iof.179.1568932336544; 
	Thu, 19 Sep 2019 15:32:16 -0700 (PDT)
MIME-Version: 1.0
From: Carl Eugen Hoyos <[email protected]>
Date: Fri, 20 Sep 2019 00:32:05 +0200
Message-ID: <CAB0OVGqiFSF001jQeuBALTMUN61NO23gjGrza-RNPM9uQdq1gw@mail.gmail.com>
To: FFmpeg development discussions and patches <[email protected]>
Content-Type: multipart/mixed; boundary="00000000000098e6960592ef8666"
Subject: [FFmpeg-devel] [PATCH]lavc/opus: Create extradata if it is missing
X-BeenThere: [email protected]
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <http://ffmpeg.org/mailman/options/ffmpeg-devel>,
	<mailto:[email protected]?subject=unsubscribe>
List-Archive: <http://ffmpeg.org/pipermail/ffmpeg-devel/>
List-Post: <mailto:[email protected]>
List-Help: <mailto:[email protected]?subject=help>
List-Subscribe: <http://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
	<mailto:[email protected]?subject=subscribe>
Reply-To: FFmpeg development discussions and patches
	<[email protected]>
Errors-To: [email protected]
Sender: "ffmpeg-devel" <[email protected]>
This patch fixes the remuxing of OPUS audio into MP4 container, as per the
issue described here:
http://ffmpeg.org/pipermail/ffmpeg-user/2019-September/045274.html
but introduces a regression for WEBM recordings.
(Originally posted here, with attachments:
http://ffmpeg.org/pipermail/ffmpeg-user/2019-September/045475.html)
I'm afraid some further testing shows that the patch did actually fix
the case of missing extradata when recording OPUS with MP4, but it in
turn breaks the case of WEBM. Didn't try other formats, yet, but there
is a clear regression for the WEBM format.
Report logs attached for both before and after applying the patch. No
meaningful differences in the log, though. The only visible effect of
the regression is when trying to open up the WEBM file in VLC. ffplay is
able to play it, though.
VLC says this when trying to play the WEBM file:
[00007f8978053e20] opus decoder error: cannot read Opus header
[00007f8978053e20] opus decoder error: initial Opus header is corrupted
From 957e568e7dd1c2acc0ea29dad122919c8c9e05ce Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <[email protected]>
Date: Fri, 20 Sep 2019 00:29:16 +0200
Subject: [PATCH] lavc/opus: Create extradata if it is missing.
Fixes streamcopying from sdp.
Reported-by: Juan Navarro, juan dot navarro at gmx dot es
 libavcodec/opus.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index f74278a7e3..2f1045facb 100644
--- a/libavcodec/opus.c
+++ b/libavcodec/opus.c
@@ -307,12 +307,16 @@  av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
                    "Multichannel configuration without extradata.\n");
             return AVERROR(EINVAL);
-        extradata      = opus_default_extradata;
-        extradata_size = sizeof(opus_default_extradata);
-    } else {
-        extradata = avctx->extradata;
-        extradata_size = avctx->extradata_size;
+        avctx->extradata = av_malloc(sizeof(opus_default_extradata) + AV_INPUT_BUFFER_PADDING_SIZE);
+        if (!avctx->extradata)
+            return AVERROR(ENOMEM);
+        memcpy(avctx->extradata, opus_default_extradata, sizeof(opus_default_extradata));
+        memset(avctx->extradata + sizeof(opus_default_extradata), 0, AV_INPUT_BUFFER_PADDING_SIZE);
+        avctx->extradata_size = sizeof(opus_default_extradata);
+        avctx->extradata[9] = avctx->channels;
+    extradata = avctx->extradata;
+    extradata_size = avctx->extradata_size;
     if (extradata_size < 19) {
         av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n",
@@ -330,7 +334,7 @@  av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
     if (avctx->internal)
         avctx->internal->skip_samples = avctx->delay;
-    channels = avctx->extradata ? extradata[9] : (avctx->channels == 1) ? 1 : 2;
+    channels = extradata[9];
     if (!channels) {
         av_log(avctx, AV_LOG_ERROR, "Zero channel count specified in the extradata\n");
         return AVERROR_INVALIDDATA;
2.23.0