From patchwork Mon Sep 26 10:39:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 724 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp1836297vsd; Mon, 26 Sep 2016 03:39:56 -0700 (PDT) X-Received: by 10.194.201.230 with SMTP id kd6mr17429573wjc.167.1474886396484; Mon, 26 Sep 2016 03:39:56 -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 d86si7970987wmh.30.2016.09.26.03.39.50; Mon, 26 Sep 2016 03:39:56 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A10A7689BF5; Mon, 26 Sep 2016 13:39:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-3.mx.upcmail.net (vie01a-dmta-pe04-3.mx.upcmail.net [62.179.121.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DDE22689B71 for ; Mon, 26 Sep 2016 13:39:23 +0300 (EEST) Received: from [172.31.216.44] (helo=vie01a-pemc-psmtp-pe02) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1boTK0-0000V4-9x for ffmpeg-devel@ffmpeg.org; Mon, 26 Sep 2016 12:39:40 +0200 Received: from [192.168.1.3] ([80.110.111.220]) by vie01a-pemc-psmtp-pe02 with SMTP @ mailcloud.upcmail.net id oAff1t0084lMiqw01AfgKl; Mon, 26 Sep 2016 12:39:40 +0200 X-SourceIP: 80.110.111.220 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Mon, 26 Sep 2016 12:39:39 +0200 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201609261239.39069.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavf/riffenc: Always write unexpected channel_mask 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Attached patch allows to write arbitrary (mono) channel_masks even for 16bit 48kHz pcm audio. Please comment, Carl Eugen From bbbbde791edddeb16aadaa28f7ab53f1f60a9874 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 26 Sep 2016 12:36:54 +0200 Subject: [PATCH] lavf/riffenc: Always write unexpected channel_mask. --- libavformat/riffenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c index 36e6ac7..8ff7923 100644 --- a/libavformat/riffenc.c +++ b/libavformat/riffenc.c @@ -71,6 +71,8 @@ int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, frame_size = av_get_audio_frame_duration2(par, par->block_align); waveformatextensible = (par->channels > 2 && par->channel_layout) || + par->channels == 1 && par->channel_layout && par->channel_layout != AV_CH_LAYOUT_MONO || + par->channels == 2 && par->channel_layout && par->channel_layout != AV_CH_LAYOUT_STEREO || par->sample_rate > 48000 || par->codec_id == AV_CODEC_ID_EAC3 || av_get_bits_per_sample(par->codec_id) > 16;