From patchwork Thu Jun 27 19:56:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cameron Cawley X-Patchwork-Id: 13734 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 B1C8D449185 for ; Thu, 27 Jun 2019 22:58:44 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 94D6168AB05; Thu, 27 Jun 2019 22:58:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4DEC868A702 for ; Thu, 27 Jun 2019 22:58:38 +0300 (EEST) Received: by mail-wr1-f43.google.com with SMTP id r16so2001102wrl.11 for ; Thu, 27 Jun 2019 12:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/EW5xtI+8JtBn8faUvhWwSJ/nGJ1+2rZd7LClfisIuM=; b=hpPXhzFDHHNADKzNIfUxLGmNx2LA2k4ChelFiVGbTtnNyLkkZrCdZoeinSzMSIhGsc YRGi/sj4XFGHk1eijsQEDMyazyK7Yva3QeQtnvLqePC+qk0j3NVY4rj4BHFzIp2O3Fgl 11shj/18hrG0piv84n1phbRBSUM2fg8cPBf79WOmem0i14PYyhgEQEQePryfxDIyR5Bf j8FBtGe3vWAAX7+GxcGkvrPGbiNvUwcfmWCHAYKRaClsifJtvhgSZVsd4Dar9meCyLmm ex+nmXlBAtcRBhamtn1guLeign0ryH8WkT0BvgIm4ZAlod6uJ4CPCTdNfUmJb44TKXzj 4S3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/EW5xtI+8JtBn8faUvhWwSJ/nGJ1+2rZd7LClfisIuM=; b=e6p5lhg/KvgogJskT8pmas5j7oqZPiaK+g82UOEbWYmxOa6+/M2S2hN9of5OwNEqwa KutRcGIEP36gMZLyNj7vO+NAnZNIevInvkTx660YSKyt66eanqci1X22Xdzsqn1klSot BrbRibix6BXNjOajDvjjGILATcNXBgfjSjP9vK2vRyirgwZTluwOoZnIV/9E2yNyJxXd VUc8n4sVJwi7/M3b5PyZBCk2E0rAmZTzhFy5r9dB5EkylMdsE9xNknjb4VbITWP9PesV 2zddd/7zrqPazC15s7UUSmlhGEmrJkhzyHAefK/NDxo8fJrpjv2tZqsyyKWqAnH3OvR0 h7dA== X-Gm-Message-State: APjAAAXVWkHqZtDQiIkmtPJMZJ7Hj+jpHymGp9pw7iccgtw3XCjrQNSE Hal/Ok1LqvWvSA2F1+hg/iay4TVg X-Google-Smtp-Source: APXvYqynbQG5xjBYvQBiKx7Sic6o+4MDxabhIWSYPXuOXrLrRQVVVxgXP0XTg0Rca1TLsaxeKGO8lg== X-Received: by 2002:adf:dd8c:: with SMTP id x12mr4503489wrl.212.1561665517487; Thu, 27 Jun 2019 12:58:37 -0700 (PDT) Received: from localhost.localdomain (host109-150-111-125.range109-150.btcentralplus.com. [109.150.111.125]) by smtp.gmail.com with ESMTPSA id x83sm5865590wmb.42.2019.06.27.12.58.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 12:58:37 -0700 (PDT) From: Cameron Cawley To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Jun 2019 20:56:02 +0100 Message-Id: <20190627195602.10889-2-ccawley2011@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190627195602.10889-1-ccawley2011@gmail.com> References: <20190627195602.10889-1-ccawley2011@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avformat/rpl: Support files containing Replay IMA ADPCM audio 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: Cameron Cawley MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/rpl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libavformat/rpl.c b/libavformat/rpl.c index dbbcd13b41..b4859320f4 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -121,6 +121,7 @@ static int rpl_read_header(AVFormatContext *s) int error = 0; const char *endptr; char audio_type[RPL_LINE_LENGTH]; + char audio_codec[RPL_LINE_LENGTH]; uint32_t i; @@ -189,7 +190,9 @@ static int rpl_read_header(AVFormatContext *s) // ARMovie supports multiple audio tracks; I don't have any // samples, though. This code will ignore additional tracks. - audio_format = read_line_and_int(pb, &error); // audio format ID + error |= read_line(pb, line, sizeof(line)); + audio_format = read_int(line, &endptr, &error); // audio format ID + strcpy(audio_codec, endptr); if (audio_format) { ast = avformat_new_stream(s, NULL); if (!ast) @@ -229,6 +232,14 @@ static int rpl_read_header(AVFormatContext *s) break; } } + break; + case 2: + if (av_strcasecmp(audio_codec," adpcm") == 0) { + ast->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_ACORN; + } else { + avpriv_report_missing_feature(s, "Audio format %"PRId32" (%s)", + audio_format, audio_codec); + } // There are some other formats listed as legal per the spec; // samples needed. break;