From patchwork Tue Apr 3 10:35:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hendrik Leppkes X-Patchwork-Id: 8302 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.70 with SMTP id c67csp3526326jad; Tue, 3 Apr 2018 03:41:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+UVRKLCIBNL0H3FxLUNkevfbXg9H8/cqi/EcSNAFD/mQ7uGR7ej2ZDAdOQkStuVByJW1vD X-Received: by 10.28.110.17 with SMTP id j17mr4198095wmc.65.1522752119597; Tue, 03 Apr 2018 03:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522752119; cv=none; d=google.com; s=arc-20160816; b=ST8Jg+XXILVu0QJ3ODM8K00Bln8jtfjLreouPP6PAcR/0HtiYSxvB0jiwj77/QrY0Z CVqmqqPuoQ8SO0JIt5BVAFfpVStZCasXg0NqXvb4F5mBnE7fAIzyvzP9wIlXCc/nKe5X UjkIbIkzJtCY6DoDkNCSPyQOJM2xCSTJzj1yhJbYv8Cky2xt9ClLdK7ok5Atmx+mDVzX kn1vWiKn+RFQUMLKJPTxcShpaYR0YmT6QV6tGsRzyhzXCwU91htDDreWS2XMrWTMHIZa 7cDnx/NywetUMbgg3Uz94nOPR4k9I1Rv6+DKYU+oJNV43LlA5SbP60SPRiOAk5oEPM3x 3d6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=Y1Eb+W7cHOWH1kUej8HrMMqDV0hl4ttB6VJ+jkHbWe0=; b=fcEh7YXkmxPi1+ai+Nhf6fYBN9oJ9Dkbasch29UDH4uw7eE5CnoG4/lYvvuBM6ZnHE GGoCE5Hw0x2NMnjL33MTIMuZKwbzEKPaViGt8mzb9s3IyOCy6P9HJZUbQp0GmzNeOHpZ pWALlT/VwHUJaJIriBtbgY8VM4Vcwqgbeah8rbrUoAp8+BFbTAtqEhAV9muANaIiuDky h4gpYdBAZzNxp3IP1KbUR/EhFI1RtNxeTCFzFBKRfiXmMIO0jQvUnRYvROF5QhRxrHe9 KpDdrjz7gz+RWFLmJyp6ybzaZNxHSolSC8BZYlfPfK34VhDZtzlWr9VPFBMlKkioM2CK 4Phg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ior5GVyq; 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 sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a19si166186wmg.162.2018.04.03.03.41.58; Tue, 03 Apr 2018 03:41:59 -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 header.s=20161025 header.b=ior5GVyq; 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 sp=QUARANTINE 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 48EE6688366; Tue, 3 Apr 2018 13:41:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 45B15680467 for ; Tue, 3 Apr 2018 13:41:30 +0300 (EEST) Received: by mail-wm0-f54.google.com with SMTP id x4so34117326wmh.5 for ; Tue, 03 Apr 2018 03:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=b3cnHAsPqlDGVK7wgr8Tam4qgOlyZ7x7A558P3emtOI=; b=ior5GVyqNCninHhdGyml+u6cQmYwJA+QY/AwB2sW3MWiM2XQGUd/pInPTFcOb7BP3u xO4r4UsDa6lVH3gnvf2MCL5yzuvqlXNHcoHDMAquWaxfbD3KXKKoN0epsBduIXcB2rT3 U3uhRT1N1WDFvFYQhlNZRRFf50Micd02tLFDangbE+7xk37KyLyuT//tga/GMdAD1p1H u3xCvp7bim9iqq7A6J9+jbiZapgyu6DcoO0A2ulr+vIa8c2jWFRCKbCOzJt0HZjWcx/h +IwXXZybQ/FHQ2nF+4Uivs878vzEADgEHmZTHQH97bxJsGHafsLFRiSyHI9ei4FWpgus alPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=b3cnHAsPqlDGVK7wgr8Tam4qgOlyZ7x7A558P3emtOI=; b=NnPvgM+cZ/smxx2LFAFvJJI6L2vRI41f0Yhj3PHYwFhBCYGk0vVo1MwFwsZ1BNvtLr GKwV/00r5seC64CdqPEljzH6cmFq4Toevjp/CabvIbcrxR72NK4t5qcx2mtr3XWGwg/w df/oMZntynNN28PqSMpHnTuRgn2URheSeFd0lT7Xl1wFpI/rq/w9PEA75lkl14EPtx5D f5fcLllGSGgx7X1FB6o8nXQZBNXBJrfNo3XrlIxg7SMCQ4VA9CLfvds7lVbu/NuzPWKA VchjuuF2CQ04kHRgW3jqLUaL1sQFS7I3wbcJtw8twLOqIQH70Xqs6hZixmYDuSiULYbZ lKoQ== X-Gm-Message-State: ALQs6tCn9zCwmW6+eX53Hpwk480swMbesrBqfuZ16h3mlSvqdagw1VG2 4gUlsOFp4FwQgV6A7A1x9N1jaDZB X-Received: by 10.28.69.133 with SMTP id l5mr3263730wmi.152.1522751729794; Tue, 03 Apr 2018 03:35:29 -0700 (PDT) Received: from localhost (p4FC4F922.dip0.t-ipconnect.de. [79.196.249.34]) by smtp.gmail.com with ESMTPSA id 67sm2320938wra.9.2018.04.03.03.35.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 03:35:29 -0700 (PDT) From: Hendrik Leppkes To: ffmpeg-devel@ffmpeg.org Date: Tue, 3 Apr 2018 12:35:27 +0200 Message-Id: <20180403103527.20364-1-h.leppkes@gmail.com> X-Mailer: git-send-email 2.16.1.windows.4 Subject: [FFmpeg-devel] [PATCH] spdifenc: support ac3 core+eac3 dependent 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" Such streams are found on Blu-ray, and identified as EAC3 type in avformat, while the bitstream of the core stream is actually a pure AC3 frame. Adjust the parsing accordingly, since AC3 frames always hold 6 blocks and the numblkscod syntax element is not present. --- libavformat/spdifenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c index 3a50aebbef..9514ff8e10 100644 --- a/libavformat/spdifenc.c +++ b/libavformat/spdifenc.c @@ -118,7 +118,8 @@ static int spdif_header_eac3(AVFormatContext *s, AVPacket *pkt) static const uint8_t eac3_repeat[4] = {6, 3, 2, 1}; int repeat = 1; - if ((pkt->data[4] & 0xc0) != 0xc0) /* fscod */ + int bsid = pkt->data[5] >> 3; + if (bsid > 10 && (pkt->data[4] & 0xc0) != 0xc0) /* fscod */ repeat = eac3_repeat[(pkt->data[4] & 0x30) >> 4]; /* numblkscod */ ctx->hd_buf = av_fast_realloc(ctx->hd_buf, &ctx->hd_buf_size, ctx->hd_buf_filled + pkt->size);