From patchwork Thu Aug 8 21:09:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cameron Cawley X-Patchwork-Id: 14336 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 97DCF44A04A for ; Fri, 9 Aug 2019 00:21:01 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 81017689909; Fri, 9 Aug 2019 00:21:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FB76680328 for ; Fri, 9 Aug 2019 00:20:55 +0300 (EEST) Received: by mail-wr1-f51.google.com with SMTP id k2so10431934wrq.2 for ; Thu, 08 Aug 2019 14:20:55 -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=08Ds7391X7o+VAg6ZMBMjztLO9pKT4Cal6CHex6sRdo=; b=nRmrhb4H29p4Q4NupwgrVwYRDi/T3SA+Cs1hGPuOJA48N8CHwRdkEknUkVUmDNjjF+ GEEpNX45hh0QVqPxIniywc2P9CJIHmYKM58fadqz8M//V2hH0IfwOtOQmZsJLivVb2Zl 59xMphGY+ZBX5ssNLcmXz16x3DQjLMV2gqHLLswwCoCd820PmwKF3LVjRCoilwl7HdCL wB8RTyKFEVcvjRCPcWNx/5QdeWYfV3p1Gb8NGDcBlWRj4mZkSG+HNF/AbaNUqbPYIdKI azm9FMB8TSUmI4WB2/UDbm9FZxWpRyFGYv6OwYITh8xep+pn4fRqCL0f24NUmdny+ek5 YEjA== 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=08Ds7391X7o+VAg6ZMBMjztLO9pKT4Cal6CHex6sRdo=; b=iNvmK9+S/NcQXTUtEN9sKRHMrAGXkkZZOz0j7d5qpV1Z2I79w0tbJPIw+UmsABK0Q0 Y71miRlh+Mk/uejujnEXdResHogHHNgBuIATgJsYRQrrIlvmFmj6K1Y8w6D7y/araSp7 j7u1+A1B4pJZAzELr2IqtGKt+HCEG6GES5GfYaI+3c0giiYv/MYwQt3UYz1spymfuEKe JIxx1rVrlgu9/TovKl9+Nz7tdoq2E0oVl1F6KIfQMpTTq5BuiEoVTBmeZrwWmQn2dfzk MBSquDhUHmqMFjcJFXTHHmuzDDd5jycx0Cz8FOR23+3myxjurtvCNIPH+IRop8dwuPcP J1ew== X-Gm-Message-State: APjAAAWpNUGCy6OQigqULEXRc+mzfp0jc+Z6OT5VfUCp7u5k0v5H9xfg AIDezHLBCoXTZdWdMlhz/oYh3/hh X-Google-Smtp-Source: APXvYqx25BMXUPmDhnAidLWAnkK9443Uj4N3jnlqyfht0QQtXHAhJiGPCCEr/Wkw4XX24DHosiLFgw== X-Received: by 2002:a5d:6b11:: with SMTP id v17mr19246945wrw.323.1565298922748; Thu, 08 Aug 2019 14:15:22 -0700 (PDT) Received: from localhost.localdomain (host81-157-187-89.range81-157.btcentralplus.com. [81.157.187.89]) by smtp.gmail.com with ESMTPSA id z25sm2510682wmf.38.2019.08.08.14.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 14:15:22 -0700 (PDT) From: Cameron Cawley To: ffmpeg-devel@ffmpeg.org Date: Thu, 8 Aug 2019 22:09:05 +0100 Message-Id: <20190808210905.24456-2-ccawley2011@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190808210905.24456-1-ccawley2011@gmail.com> References: <20190808210905.24456-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 6afd373810..d31c7f09ad 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 + av_strlcpy(audio_codec, endptr, RPL_LINE_LENGTH); 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;