From patchwork Wed Jan 15 10:55:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17362 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 109DB44B4B1 for ; Wed, 15 Jan 2020 12:56:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E3AF068B0EF; Wed, 15 Jan 2020 12:56:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94C5A68A280 for ; Wed, 15 Jan 2020 12:56:06 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPPy0RTjzHh9H; Wed, 15 Jan 2020 10:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085766; bh=o+1+IgqBis1jLU+xLk18YST8uL2eqtP7VORAZQw0Cws=; h=From:To:Cc:Subject:Date:Message-Id; b=MthNfYy+hNzTjZisDqEIpbZKgsH3mOC8tc2nYrMhnORmkguvfQ3ZxfR1C+s1HMup3 tyEjP6HwbFer+ol68IL1er8JPZ/UmXdEXs0peCO1q42Zb2YFPRPigJ5nky7nl8Kquw 9yDrWg+StR17n5yyzuP95Nks3/5UBRugiMC92K8k= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id C7E5A3FA6D; Wed, 15 Jan 2020 11:56:07 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:55:55 +0100 Message-Id: <20200115105602.1184-2-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 1/8] avformat/s337m: Use base AVClass for av_log usage 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" s337m_get_offset_and_codec does not make use of AVFormatContext: AVClass is enough for logging. Will facilitate further use from outside --- libavformat/s337m.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/s337m.c b/libavformat/s337m.c index 48ab66a6da..8956afb23f 100644 --- a/libavformat/s337m.c +++ b/libavformat/s337m.c @@ -31,7 +31,7 @@ #define IS_24LE_MARKER(state) ((state & 0xFFFFFFFFFFFF) == MARKER_24LE) #define IS_LE_MARKER(state) (IS_16LE_MARKER(state) || IS_20LE_MARKER(state) || IS_24LE_MARKER(state)) -static int s337m_get_offset_and_codec(AVFormatContext *s, +static int s337m_get_offset_and_codec(void *avc, uint64_t state, int data_type, int data_size, int *offset, enum AVCodecID *codec) @@ -50,8 +50,8 @@ static int s337m_get_offset_and_codec(AVFormatContext *s, } if ((data_type & 0x1F) != 0x1C) { - if (s) - avpriv_report_missing_feature(s, "Data type %#x in SMPTE 337M", data_type & 0x1F); + if (avc) + avpriv_report_missing_feature(avc, "Data type %#x in SMPTE 337M", data_type & 0x1F); return AVERROR_PATCHWELCOME; } @@ -72,8 +72,8 @@ static int s337m_get_offset_and_codec(AVFormatContext *s, *offset = 1601; break; default: - if (s) - avpriv_report_missing_feature(s, "Dolby E data size %d in SMPTE 337M", data_size); + if (avc) + avpriv_report_missing_feature(avc, "Dolby E data size %d in SMPTE 337M", data_size); return AVERROR_PATCHWELCOME; } From patchwork Wed Jan 15 10:55:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17363 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0AF1844B4B1 for ; Wed, 15 Jan 2020 12:56:15 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E830368B0EE; Wed, 15 Jan 2020 12:56:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CAA5D68A280 for ; Wed, 15 Jan 2020 12:56:06 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPPy39wszHh9S; Wed, 15 Jan 2020 10:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085766; bh=bI389JMzPhrrrNh7pXN3NPYTX7AYCjukC4nKbslyXv0=; h=From:To:Cc:Subject:Date:Message-Id; b=eun3UsFVm46xi55t7Qrw4wVKzcZa5Yci5GKW14xh6zBFoyC/Hkhlz9yGuM+MMiy1E 5E2M9XJlqWswlFYcbauMtprs4yd97KHGQ6VVUw3X4oEyRrdv3h6XsHwtDbpT9VkwGz HcVxq+6Fj/0wTTpJmr++6FKfHIWBNio2Aq08t1w0= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id 302153FA74; Wed, 15 Jan 2020 11:56:08 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:55:56 +0100 Message-Id: <20200115105602.1184-3-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 2/8] avformat/s337m: Split read_packet/get_packet 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Prepare use of s337m_get_packet from outside. --- libavformat/s337m.c | 26 ++++++++++++++++++++------ libavformat/s337m.h | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 libavformat/s337m.h diff --git a/libavformat/s337m.c b/libavformat/s337m.c index 8956afb23f..9776cf1bf1 100644 --- a/libavformat/s337m.c +++ b/libavformat/s337m.c @@ -21,6 +21,7 @@ #include "libavutil/intreadwrite.h" #include "avformat.h" #include "spdif.h" +#include "s337m.h" #define MARKER_16LE 0x72F81F4E #define MARKER_20LE 0x20876FF0E154 @@ -141,18 +142,20 @@ static void bswap_buf24(uint8_t *data, int size) FFSWAP(uint8_t, data[0], data[2]); } -static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt) +int ff_s337m_get_packet(AVIOContext *pb, AVPacket *pkt, int size, enum AVCodecID *codec, void *avc) { - AVIOContext *pb = s->pb; uint64_t state = 0; int ret, data_type, data_size, offset; - enum AVCodecID codec; - int64_t pos; + int64_t pos, orig_pos = avio_tell(pb); while (!IS_LE_MARKER(state)) { state = (state << 8) | avio_r8(pb); if (avio_feof(pb)) return AVERROR_EOF; + if (avio_tell(pb) - orig_pos + 6 >= size) { + av_log(avc, AV_LOG_ERROR, "s337m : sync bytes not found at packet pos=0x%"PRIx64" size=%d\n", orig_pos, size); + return AVERROR_INVALIDDATA; + } } if (IS_16LE_MARKER(state)) { @@ -165,10 +168,10 @@ static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt) pos = avio_tell(pb); - if ((ret = s337m_get_offset_and_codec(s, state, data_type, data_size, &offset, &codec)) < 0) + if ((ret = s337m_get_offset_and_codec(avc, state, data_type, data_size, &offset, codec)) < 0) return ret; - if ((ret = av_new_packet(pkt, offset)) < 0) + if (ret = av_new_packet(pkt, FFMIN(offset, size - (pos - orig_pos))) < 0) return ret; pkt->pos = pos; @@ -183,6 +186,17 @@ static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt) else bswap_buf24(pkt->data, pkt->size); + return 0; +} + +static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + enum AVCodecID codec; + int ret; + + if ((ret = ff_s337m_get_packet(s->pb, pkt, avio_size(s->pb), &codec, s)) < 0) + return ret; + if (!s->nb_streams) { AVStream *st = avformat_new_stream(s, NULL); if (!st) { diff --git a/libavformat/s337m.h b/libavformat/s337m.h new file mode 100644 index 0000000000..f7bd0c16f6 --- /dev/null +++ b/libavformat/s337m.h @@ -0,0 +1,37 @@ +/* + * SMPTE ST 337 common header + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_S337M_H +#define AVFORMAT_S337M_H + +/** + * Read s337m packets in a PCM_S16LE/S24LE stereo stream + * Returns the first inner packet found + * Note that it does not require a clean guard band + * @param pb Associated IO context + * @param pkt On success, returns a DOLBY E packet + * @param size Maximum IO read size available for reading at current position + * @param codec Returns AV_CODEC_ID_DOLBY_E + * @param avc For av_log + * @return = 0 on success (an error is raised if no s337m was found) + */ +int ff_s337m_get_packet(AVIOContext *pb, AVPacket *pkt, int size, enum AVCodecID *codec, void *avc); + +#endif /* AVFORMAT_S337M_H */ From patchwork Wed Jan 15 10:55:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17366 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D2B7A44B4B1 for ; Wed, 15 Jan 2020 12:56:17 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BE99268B0FD; Wed, 15 Jan 2020 12:56:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2A80368B05E for ; Wed, 15 Jan 2020 12:56:07 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPPy5rlGzHh9Y; Wed, 15 Jan 2020 10:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085766; bh=RMk14FzYtEeJzttqe6gSowpR6kMq2W+c1mS0jCRWSo0=; h=From:To:Cc:Subject:Date:Message-Id; b=k23fKfeJKLghi4auVqduBJ/ynSuTj1IlqmC/mB+rRiZU+X/1+tMGFvSZRs9WD2kDh FaHNj2HiLIpN0/Ngze7K54TjtmWXRSQFRxZ8TiPdvnnSIrtzjlAkM5SYWTu5bIjPxn jZEa4Go9Pz8aCQMD1LBfUenS8rhXZjkjPwf6OUm0= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id 8D5223FA6D; Wed, 15 Jan 2020 11:56:08 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:55:57 +0100 Message-Id: <20200115105602.1184-4-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 3/8] avformat/s337m: Consider container bit resolution 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Prepare the support of s337m in muxers other than raw (ex: wav). For example, this forbids reading 16 bits DolbyE stream from a 24 bit wav file. --- libavformat/s337m.c | 20 ++++++++++++++------ libavformat/s337m.h | 3 ++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libavformat/s337m.c b/libavformat/s337m.c index 9776cf1bf1..f162f86762 100644 --- a/libavformat/s337m.c +++ b/libavformat/s337m.c @@ -34,7 +34,7 @@ static int s337m_get_offset_and_codec(void *avc, uint64_t state, - int data_type, int data_size, + int data_type, int data_size, int container_word_bits, int *offset, enum AVCodecID *codec) { int word_bits; @@ -55,6 +55,11 @@ static int s337m_get_offset_and_codec(void *avc, avpriv_report_missing_feature(avc, "Data type %#x in SMPTE 337M", data_type & 0x1F); return AVERROR_PATCHWELCOME; } + if (container_word_bits && !(container_word_bits == 16 && word_bits == 16) && !(container_word_bits == 24 && word_bits == 20) && !(container_word_bits == 24 && word_bits == 24)) { + if (avc) + av_log(avc, AV_LOG_ERROR, "s337m: Container is %d bits vs. stream is %d bits\n", container_word_bits, word_bits); + return AVERROR_INVALIDDATA; + } if (codec) *codec = AV_CODEC_ID_DOLBY_E; @@ -104,7 +109,7 @@ static int s337m_probe(const AVProbeData *p) data_size = AV_RL24(buf + 3); } - if (s337m_get_offset_and_codec(NULL, state, data_type, data_size, &offset, NULL)) + if (s337m_get_offset_and_codec(NULL, state, data_type, data_size, 0, &offset, NULL)) continue; i = IS_16LE_MARKER(state) ? 0 : IS_20LE_MARKER(state) ? 1 : 2; @@ -142,13 +147,16 @@ static void bswap_buf24(uint8_t *data, int size) FFSWAP(uint8_t, data[0], data[2]); } -int ff_s337m_get_packet(AVIOContext *pb, AVPacket *pkt, int size, enum AVCodecID *codec, void *avc) +int ff_s337m_get_packet(AVIOContext *pb, AVPacket *pkt, int size, enum AVCodecID *codec, void *avc, int container_word_bits) { uint64_t state = 0; int ret, data_type, data_size, offset; int64_t pos, orig_pos = avio_tell(pb); - while (!IS_LE_MARKER(state)) { + if (container_word_bits && container_word_bits != 16 && container_word_bits != 24) + return AVERROR_INVALIDDATA; + while ((container_word_bits == 24 || !IS_16LE_MARKER(state)) + && (container_word_bits == 16 || !IS_20LE_MARKER(state) && !IS_24LE_MARKER(state))) { state = (state << 8) | avio_r8(pb); if (avio_feof(pb)) return AVERROR_EOF; @@ -168,7 +176,7 @@ int ff_s337m_get_packet(AVIOContext *pb, AVPacket *pkt, int size, enum AVCodecID pos = avio_tell(pb); - if ((ret = s337m_get_offset_and_codec(avc, state, data_type, data_size, &offset, codec)) < 0) + if ((ret = s337m_get_offset_and_codec(avc, state, data_type, data_size, container_word_bits, &offset, codec)) < 0) return ret; if (ret = av_new_packet(pkt, FFMIN(offset, size - (pos - orig_pos))) < 0) @@ -194,7 +202,7 @@ static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt) enum AVCodecID codec; int ret; - if ((ret = ff_s337m_get_packet(s->pb, pkt, avio_size(s->pb), &codec, s)) < 0) + if ((ret = ff_s337m_get_packet(s->pb, pkt, avio_size(s->pb), &codec, s, 0)) < 0) return ret; if (!s->nb_streams) { diff --git a/libavformat/s337m.h b/libavformat/s337m.h index f7bd0c16f6..af2c4c85a3 100644 --- a/libavformat/s337m.h +++ b/libavformat/s337m.h @@ -30,8 +30,9 @@ * @param size Maximum IO read size available for reading at current position * @param codec Returns AV_CODEC_ID_DOLBY_E * @param avc For av_log + * @param container_word_bits 16,24, or 0 for autodetect * @return = 0 on success (an error is raised if no s337m was found) */ -int ff_s337m_get_packet(AVIOContext *pb, AVPacket *pkt, int size, enum AVCodecID *codec, void *avc); +int ff_s337m_get_packet(AVIOContext *pb, AVPacket *pkt, int size, enum AVCodecID *codec, void *avc, int container_word_bits); #endif /* AVFORMAT_S337M_H */ From patchwork Wed Jan 15 10:55:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17367 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 03ECB44B4B1 for ; Wed, 15 Jan 2020 12:56:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DD87B68B112; Wed, 15 Jan 2020 12:56:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8856068AD88 for ; Wed, 15 Jan 2020 12:56:07 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPPz1SyYzHh9Z; Wed, 15 Jan 2020 10:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085767; bh=DH9Bzu1ihskHIHybj6mIag0AB5nASNNm59+vF9G31ps=; h=From:To:Cc:Subject:Date:Message-Id; b=VoXhRm8WzWNSz2zkhswjI1u1nEVPzl4K21ujMNfjqJYOpsWNK7RACQkaW2RtmabM8 ebkg7BiH7CztAJGolBdSzA0lLR0Z91dSXM+gw6dEMS5PVU4ZiZbrF6oTsjhDa3leFc pdfTGpYEZWx3nQ9YMjI/XEnJ8uddxUSn3Cybl+aw= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id E9FFF3FA6D; Wed, 15 Jan 2020 11:56:08 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:55:58 +0100 Message-Id: <20200115105602.1184-5-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 4/8] avformat/s337m: New ff_s337m_probe() 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Similar to ff_spdif_probe() with just an additional checking of the bit resolution of the container as it may be 16 or 24 for s337m. --- libavformat/s337m.c | 32 ++++++++++++++++++++++++++++++++ libavformat/s337m.h | 16 ++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/libavformat/s337m.c b/libavformat/s337m.c index f162f86762..129bee16bc 100644 --- a/libavformat/s337m.c +++ b/libavformat/s337m.c @@ -133,6 +133,38 @@ static int s337m_probe(const AVProbeData *p) return 0; } +int ff_s337m_probe(const uint8_t *buf, int size, enum AVCodecID *codec, int container_word_bits) +{ + int pos = 0; + int consecutive_codes = 0; + + if ( size < S337M_MIN_OFFSET) + return 0; + size = FFMIN(3 * S337M_MAX_OFFSET, size); + if (container_word_bits != 16 && container_word_bits != 24) + return AVERROR_INVALIDDATA; + + do { + uint64_t state; + int data_type, data_size, offset; + while (pos < size - 12 && !buf[pos]) { + pos++; + } + if (pos >= size - 12 || pos < S337M_PROBE_GUARDBAND_MIN_BYTES || pos % (container_word_bits == 16 ? 4 : 6)) + return 0; + state = container_word_bits == 16 ? AV_RB32(buf + pos) : AV_RB48(buf + pos); + if (!IS_LE_MARKER(state)) + return 0; + data_type = container_word_bits == 16 ? AV_RL16(buf + pos + 4) : AV_RL24(buf + pos + 6); + data_size = container_word_bits == 16 ? AV_RL16(buf + pos + 6) : AV_RL24(buf + pos + 9); + if (s337m_get_offset_and_codec(NULL, state, data_type, data_size, container_word_bits, &offset, codec)) + return 0; + pos = ++consecutive_codes * (offset + 4*(container_word_bits == 16 ? 4 : 6)); + } while (consecutive_codes < 3); + + return AVPROBE_SCORE_MAX; +} + static int s337m_read_header(AVFormatContext *s) { s->ctx_flags |= AVFMTCTX_NOHEADER; diff --git a/libavformat/s337m.h b/libavformat/s337m.h index af2c4c85a3..94e79dce5d 100644 --- a/libavformat/s337m.h +++ b/libavformat/s337m.h @@ -21,6 +21,22 @@ #ifndef AVFORMAT_S337M_H #define AVFORMAT_S337M_H +#define S337M_MIN_OFFSET 1601*4 +#define S337M_MAX_OFFSET 2002*6 + +#define S337M_PROBE_GUARDBAND_MIN_BYTES 0 + +/** + * Detect s337m packets in a PCM_S16LE/S24LE stereo stream + * Requires 3 samples with enough (S337M_PROBE_GUARDBAND_MIN_BYTES) and clean (set to zero) guard band + * @param p_buf Buffer + * @param size Buffer size + * @param codec Returns AV_CODEC_ID_DOLBY_E upon successful probing + * @param container_word_bits 16 or 24 + * @return = AVPROBE_SCORE + */ +int ff_s337m_probe(const uint8_t *p_buf, int size, enum AVCodecID *codec, int container_word_bits); + /** * Read s337m packets in a PCM_S16LE/S24LE stereo stream * Returns the first inner packet found From patchwork Wed Jan 15 10:55:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17368 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id F41CC44B4B1 for ; Wed, 15 Jan 2020 12:56:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E1A2268B118; Wed, 15 Jan 2020 12:56:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C06B068B100 for ; Wed, 15 Jan 2020 12:56:11 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPPz4941zHh9X; Wed, 15 Jan 2020 10:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085767; bh=NyCoFpdrr3U5JR/Q5tM2n6y192xWolg7MhJx+hucOW4=; h=From:To:Cc:Subject:Date:Message-Id; b=l1jZcOwTQ4q6PhEW7oFwNGsK2Lrli3Ip5AvZhHRSmVgPHHpUEyqcfoGGkVF0dVyPk FM3teBouy/hsSxLRoEjY0T3Y6DaLaox1XjAmzbhRcsKjgyoR7M913S79LS1G8jpkxa wXHLPy4ihSrhYKMjUJeF7YlulyeBPp1ok/46ao6k= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id 535C63FA6D; Wed, 15 Jan 2020 11:56:09 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:55:59 +0100 Message-Id: <20200115105602.1184-6-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 5/8] avformat/wavdec: s337m support 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Add s337m probing/reading similarly to spdif. --- libavformat/wavdec.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 575c667452..d030ed9f9d 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -41,6 +41,7 @@ #include "riff.h" #include "w64.h" #include "spdif.h" +#include "s337m.h" typedef struct WAVDemuxContext { const AVClass *class; @@ -55,15 +56,17 @@ typedef struct WAVDemuxContext { int audio_eof; int ignore_length; int spdif; + int s337m; int smv_cur_pt; int smv_given_first; int unaligned; // e.g. if an odd number of bytes ID3 tag was prepended int rifx; // RIFX: integer byte order for parameters is big endian } WAVDemuxContext; -static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav) +static void set_spdif_s337m(AVFormatContext *s, WAVDemuxContext *wav) { - if (CONFIG_SPDIF_DEMUXER && s->streams[0]->codecpar->codec_tag == 1) { + AVCodecParameters *par = s->streams[0]->codecpar; + if ((CONFIG_SPDIF_DEMUXER || CONFIG_S337M_DEMUXER) && par->codec_tag == 1) { enum AVCodecID codec; int len = 1<<16; int ret = ffio_ensure_seekback(s->pb, len); @@ -80,6 +83,12 @@ static void set_spdif(AVFormatContext *s, WAVDemuxContext *wav) if (ret > AVPROBE_SCORE_EXTENSION) { s->streams[0]->codecpar->codec_id = codec; wav->spdif = 1; + } else if ((par->codec_id == AV_CODEC_ID_PCM_S16LE || par->codec_id == AV_CODEC_ID_PCM_S24LE) && par->channels == 2) { + ret = ff_s337m_probe(buf, len, &codec, par->bits_per_coded_sample); + if (ret > AVPROBE_SCORE_EXTENSION) { + s->streams[0]->codecpar->codec_id = codec; + wav->s337m = 1; + } } } avio_seek(s->pb, pos, SEEK_SET); @@ -596,7 +605,7 @@ break_loop: ff_metadata_conv_ctx(s, NULL, wav_metadata_conv); ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv); - set_spdif(s, wav); + set_spdif_s337m(s, wav); return 0; } @@ -700,6 +709,10 @@ smv_out: wav->data_end = avio_tell(s->pb) + left; } + if (CONFIG_S337M_DEMUXER && wav->s337m == 1) { + size = FFMIN(S337M_MAX_OFFSET, left); + ret = ff_s337m_get_packet(s->pb, pkt, size, NULL, s, st->codecpar->bits_per_coded_sample); + } else { size = MAX_SIZE; if (st->codecpar->block_align > 1) { if (size < st->codecpar->block_align) @@ -708,6 +721,8 @@ smv_out: } size = FFMIN(size, left); ret = av_get_packet(s->pb, pkt, size); + } + if (ret < 0) return ret; pkt->stream_index = 0; @@ -895,7 +910,7 @@ static int w64_read_header(AVFormatContext *s) avio_seek(pb, data_ofs, SEEK_SET); - set_spdif(s, wav); + set_spdif_s337m(s, wav); return 0; } From patchwork Wed Jan 15 10:56:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17369 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E224144B4B1 for ; Wed, 15 Jan 2020 12:56:20 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CCF1868B102; Wed, 15 Jan 2020 12:56:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C342A68B101 for ; Wed, 15 Jan 2020 12:56:11 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPQ019f6zHh9b; Wed, 15 Jan 2020 10:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085768; bh=QzIQLL95dw3HK8ruKUCU0oMEvV1bn6lAyHxZULE3vFQ=; h=From:To:Cc:Subject:Date:Message-Id; b=K96fILzBeObOERugYAdTLjCo3mMEJOQmc0w9z5GIRDMS267H00HPNp2/qfaI/DV6p BSQc6QyESWVIhcvlJ1ZKGoUFH7E2upUriuesAYs5RxDwsFQo7df0cZc3iTD3MDYO0v /C6CSRR207lHVGsOrphCIIDd9+qcJbopGe9vWZJE= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id B09E83FA6D; Wed, 15 Jan 2020 11:56:09 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:56:00 +0100 Message-Id: <20200115105602.1184-7-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 6/8] avformat/wavdec.c: Reindent after last commit 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/wavdec.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index d030ed9f9d..3571733817 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -713,14 +713,14 @@ smv_out: size = FFMIN(S337M_MAX_OFFSET, left); ret = ff_s337m_get_packet(s->pb, pkt, size, NULL, s, st->codecpar->bits_per_coded_sample); } else { - size = MAX_SIZE; - if (st->codecpar->block_align > 1) { - if (size < st->codecpar->block_align) - size = st->codecpar->block_align; - size = (size / st->codecpar->block_align) * st->codecpar->block_align; - } - size = FFMIN(size, left); - ret = av_get_packet(s->pb, pkt, size); + size = MAX_SIZE; + if (st->codecpar->block_align > 1) { + if (size < st->codecpar->block_align) + size = st->codecpar->block_align; + size = (size / st->codecpar->block_align) * st->codecpar->block_align; + } + size = FFMIN(size, left); + ret = av_get_packet(s->pb, pkt, size); } if (ret < 0) From patchwork Wed Jan 15 10:56:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17364 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1F26A44B4B1 for ; Wed, 15 Jan 2020 12:56:16 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0961968B0FB; Wed, 15 Jan 2020 12:56:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 116BD68A280 for ; Wed, 15 Jan 2020 12:56:12 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPQ05FgCzHh9l; Wed, 15 Jan 2020 10:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085768; bh=eofKct4J4+uFsqdM4hvUKh5UjG6YJKmbamcVNJqIg2Q=; h=From:To:Cc:Subject:Date:Message-Id; b=Wki9ebO1H7yrLidYHkpy/GcgGJH4gvUIdfJqwoY/S5tcDdvcXSy2qERIYTxvAyb3R IU0vAu+DhJS0wGEN+l3La+jNWhPIdNEAs2Fyz86EwHN0YHS22G/OdZ2IzOb4CBPXWt vLpAN/Vdycp0r5YA+wJq4T5TFURq4P5/W5fVyPAU= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id 49A153FA6D; Wed, 15 Jan 2020 11:56:10 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:56:01 +0100 Message-Id: <20200115105602.1184-8-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 7/8] avformat/wavdec: fix s337m/spdif probing beyond data_end 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/wavdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 3571733817..d8a27c79cf 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -77,7 +77,7 @@ static void set_spdif_s337m(AVFormatContext *s, WAVDemuxContext *wav) ret = AVERROR(ENOMEM); } else { int64_t pos = avio_tell(s->pb); - len = ret = avio_read(s->pb, buf, len); + len = ret = avio_read(s->pb, buf, FFMIN(len, wav->data_end - pos)); if (len >= 0) { ret = ff_spdif_probe(buf, len, &codec); if (ret > AVPROBE_SCORE_EXTENSION) { From patchwork Wed Jan 15 10:56:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 17365 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id EEA6244B4B1 for ; Wed, 15 Jan 2020 12:56:16 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D9F9968B0F9; Wed, 15 Jan 2020 12:56:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp-2.arkena.net (smtp-2.arkena.net [95.81.173.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 13D4868B050 for ; Wed, 15 Jan 2020 12:56:12 +0200 (EET) Received: from secu2 (unknown [10.180.103.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-2.arkena.net (Postfix) with ESMTPSA id 47yPQ10nS2zHh9m; Wed, 15 Jan 2020 10:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cji.paris; s=20150421; t=1579085769; bh=IJCCnqfm5OyRXX6A3WYasXBRS/ThjyFY62VZFAYIB5o=; h=From:To:Cc:Subject:Date:Message-Id; b=gsGpgJmBOMwIp7TsXYwiUWcpm1JMqpVIRaYt+Hxdydy0ertCGe5tyOkT0dWLVGLEY Won6o8g657HgYr6IIJjTnf5PvzbA8eK1Y/WJo54k73BsnW/7d5PW+DuVJo6vJyy7js 3U4nVdzByKCRxVUXNis5GPYscDqVZvT86qHSyHio= Received: from arkena.com (unknown [172.16.3.159]) by secu2 (Postfix) with ESMTP id D4CF83FA6D; Wed, 15 Jan 2020 11:56:10 +0100 (CET) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jan 2020 11:56:02 +0100 Message-Id: <20200115105602.1184-9-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.14.1.windows.1 In-Reply-To: <20200115105602.1184-1-nicolas.gaullier@cji.paris> References: <20200115105602.1184-1-nicolas.gaullier@cji.paris> Subject: [FFmpeg-devel] [PATCH v2 8/8] avformat/wavdec: Test s337m 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 Cc: Nicolas Gaullier MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Test s337m probing in wav container. Test dolby_e decoding for 24 bits with program config '5.1+2' --- tests/Makefile | 1 + tests/fate/audio.mak | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/tests/Makefile b/tests/Makefile index e5f41008d4..65cccac312 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -75,6 +75,7 @@ ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \ $(firstword $(3))_MUXER $(lastword $(3))_DEMUXER) DEMDEC = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER)) +DEMDEMDEC = $(call ALLYES, $(1)_DEMUXER $(2)_DEMUXER $(3:%=%_DECODER)) ENCMUX = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER) DEMMUX = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER) diff --git a/tests/fate/audio.mak b/tests/fate/audio.mak index c41958ea2d..2110b3c674 100644 --- a/tests/fate/audio.mak +++ b/tests/fate/audio.mak @@ -24,6 +24,11 @@ fate-dolby-e: CMD = pcm -i $(TARGET_SAMPLES)/dolby_e/16-11 fate-dolby-e: CMP = oneoff fate-dolby-e: REF = $(SAMPLES)/dolby_e/16-11.pcm +FATE_SAMPLES_AUDIO-$(call DEMDEMDEC, WAV, S337M, DOLBY_E) += fate-dolby-e-wav +fate-dolby-e-wav: CMD = pcm -i $(TARGET_SAMPLES)/dolby_e/512.wav +fate-dolby-e-wav: CMP = oneoff +fate-dolby-e-wav: REF = $(SAMPLES)/dolby_e/512.wav.pcm + FATE_SAMPLES_AUDIO-$(call DEMDEC, DSS, DSS_SP) += fate-dss-lp fate-dss-sp fate-dss-lp: CMD = framecrc -i $(TARGET_SAMPLES)/dss/lp.dss -frames 30 fate-dss-sp: CMD = framecrc -i $(TARGET_SAMPLES)/dss/sp.dss -frames 30