From patchwork Mon Sep 19 21:17:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 650 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp78507vsd; Mon, 19 Sep 2016 14:17:55 -0700 (PDT) X-Received: by 10.194.178.130 with SMTP id cy2mr25009043wjc.138.1474319875371; Mon, 19 Sep 2016 14:17:55 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id uw3si22362157wjb.68.2016.09.19.14.17.53; Mon, 19 Sep 2016 14:17:55 -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; 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 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 2ABF1689B28; Tue, 20 Sep 2016 00:17:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5F847689A4C for ; Tue, 20 Sep 2016 00:17:22 +0300 (EEST) Received: by mail-wm0-f68.google.com with SMTP id l132so115858wmf.1 for ; Mon, 19 Sep 2016 14:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=l9BvuVjFu7Pfi4OgDI908uJ6umTPMLuMC+VyxZxgrV4=; b=iCKR2YAtPWqILhcbnmHpvlqvImpwFJ9/T5E1N/kNwAzzaxkber2vY0EN5dJtbJZHSu nYKoKfq1jh/rjri72f+mVxN9HVMVkeYWmAFugze9IRBqLsDk/UlsR+H9G7lH8+12vcV2 a5UPPJ6YCbg13Gz64wEIVVLm0XnIdSzusXJNxKcluVpZPhDD/gx1sIMKaKTWyHq1rrKe EmZqJsAB0QhYOpRtGXSAjjuUq/DdynR1TxYki58UQKeNpAFyZhg78/uMyuTwb4gWOuRJ hmX880hSeiGueC8Pw9WfglxhnBms9BpsoYV53bkXryFlGA6COUJ8HVN+kt6P9PYYrD9+ puAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=l9BvuVjFu7Pfi4OgDI908uJ6umTPMLuMC+VyxZxgrV4=; b=C63wrVVKhjwfGA4sY/F1kLATeF8sf7whIZHlo3qqFUWAmyQqf6Say7KB1pU7isEIJi Am7s76GjNrbzaqNGBxsan4Kaoy/WdoxNI20q0GwfNIqrwBRMASD5lGPPd76Bc/Ecb0nW WZxzu4Bz/pN+aWzO/0aTQ7WedpifXlYXw0wxteaeZW7QgGMQ3IF2ASFH8pQz0wVrjfg5 1wyh8N9D8rvUVwxQS3VuMknjnDTLxzZ0BFZbplyPuBnEva6wd1F7gKbjf2yVClOUWZ5h YH0FpHpAsttBDPRYtA0Ep3K7X8HV1vt3FxY3lCby//PM5nW1fhhR8I4Qa/JclFPfWOWR 9ZzQ== X-Gm-Message-State: AE9vXwPIOcprclLdX5/g82eBRv+ODjlQitrJZyjdb15p5B3ryyteofGwE0erS4kB0MBJ9A== X-Received: by 10.28.95.134 with SMTP id t128mr128147wmb.99.1474319856855; Mon, 19 Sep 2016 14:17:36 -0700 (PDT) Received: from computer.gigaset.lan (199-89.dsl.iskon.hr. [89.164.199.89]) by smtp.gmail.com with ESMTPSA id t65sm23910425wmt.15.2016.09.19.14.17.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Sep 2016 14:17:35 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Sep 2016 23:17:20 +0200 Message-Id: <1474319840-13896-2-git-send-email-onemda@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1474319840-13896-1-git-send-email-onemda@gmail.com> References: <1474319840-13896-1-git-send-email-onemda@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avformat/wavdec: add support for decoding 24.0 and 16.8 floating point pcm formats 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" Fixes #5602 and #5603. Signed-off-by: Paul B Mahol --- libavformat/wavdec.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 7176cd6..9f760c1 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -560,6 +560,19 @@ break_loop: if (sample_count) st->duration = sample_count; + if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S32LE && + st->codecpar->block_align == st->codecpar->channels * 4 && + st->codecpar->bits_per_coded_sample == 32 && + st->codecpar->extradata_size == 2 && + AV_RL16(st->codecpar->extradata) == 1) { + st->codecpar->codec_id = AV_CODEC_ID_PCM_F16LE; + st->codecpar->bits_per_coded_sample = 16; + } else if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S24LE && + st->codecpar->block_align == st->codecpar->channels * 4 && + st->codecpar->bits_per_coded_sample == 24) { + st->codecpar->codec_id = AV_CODEC_ID_PCM_F24LE; + } + ff_metadata_conv_ctx(s, NULL, wav_metadata_conv); ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv);