From patchwork Tue Oct 8 08:26:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 15557 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 785A1449497 for ; Tue, 8 Oct 2019 11:44:15 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 49B86687FA8; Tue, 8 Oct 2019 11:44:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 283AB6809D2 for ; Tue, 8 Oct 2019 11:44:08 +0300 (EEST) X-QQ-mid: bizesmtp22t1570523190tm0svdxz Received: from localhost (unknown [47.90.47.25]) by esmtp6.qq.com (ESMTP) with id ; Tue, 08 Oct 2019 16:26:29 +0800 (CST) X-QQ-SSF: 01100000000000K0ZRF1000A0000000 X-QQ-FEAT: O9RHVi+JMbL9Z34aSWTMM1LvkuM+M82se1UZ/mNgk2tvatfY/s0Yq3LvIstbi 98j8jdoXZbqUmUwYHTxSeoigPeMIgyCweB7j3eNfViKMLBJ+R7No+FJCV0roemWx+nkLNbo 79Wg8ib/3e7SpTPoh1GRtudDVqZvgkS9K2C75gVhoY/6dKth37bnJorM5/unV87gNXWH6RG EVdNUU58g7kVzQ5390H9fopViUxWpqOWuagtUgePmC44kYX+c+zAsGbFNkQGOjZGjbBzJr/ vHHblwqv6S3aW8Nv7H3zpDsK2aLINjVfzwHXGeriaCD2IuTYdUxadFaqf0sCCFV94PnULQ6 gUWILZq X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Oct 2019 16:26:27 +0800 Message-Id: <20191008082627.4044-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] doc/examples/decode_audio: read the audio data from data[0] 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" only frame linesize[0] can get length size, i have tested before patch like this: ffmpeg -i /Users/liuqi/input.mp3 -codec:a ac3 -ac 5 a.ac3 ./doc/examples/decode_audio a.ac3 a.pcm ffplay -f f32le -ac 5 -ar 44100 a.pcm there have problem. no problem after this patch. Reported-by: Bepartofyou Signed-off-by: Steven Liu --- doc/examples/decode_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/decode_audio.c b/doc/examples/decode_audio.c index 6c2a8ed550..4a81302ad3 100644 --- a/doc/examples/decode_audio.c +++ b/doc/examples/decode_audio.c @@ -98,7 +98,7 @@ static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, } for (i = 0; i < frame->nb_samples; i++) for (ch = 0; ch < dec_ctx->channels; ch++) - fwrite(frame->data[ch] + data_size*i, 1, data_size, outfile); + fwrite(frame->data[0] + data_size*i, 1, data_size, outfile); } }