From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C6E7D42CDD for ; Thu, 13 Jan 2022 02:01:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B4E6068B0BA; Thu, 13 Jan 2022 03:53:00 +0200 (EET) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1B79868B0A6 for ; Thu, 13 Jan 2022 03:52:58 +0200 (EET) Received: by mail-qv1-f53.google.com with SMTP id fo11so5070306qvb.4 for ; Wed, 12 Jan 2022 17:52:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6rKbJ5Qk2cUfp7D2yBH0l9p9S1CH/YVF2ZNf+zibVFs=; b=ZVO2q4FtokFGNOb1NFL5fsvsYtinIy/CrcEE0rQDeT0VblFPG2+fFeX3KSUlKmDGQ3 s0T1GJOg6a92yiiqyP7fyWCf4nkbrh/ZeWCOgJ2Lxn8Bibn1AHJb8/O14P6E0IdqKoyk o2G+tfNOtM5aMAHDhL8YtPAkedzlMdZBtAZANw+dn2B8VaEyfb69tRZFSE8NPj6QfXS/ Fh5c1AhAy3V0hdRsSu9qskkqdVjZfKMv4f7bCf6xD1ix6CE1VQryYXdsgaI/q2ykZTcs c88Hly8/bOArGcgtcMfNj0MwERyAtwjmNFq9t0qRNojk1tMN0DZ0ebOxAaDxchyze9O+ BoaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6rKbJ5Qk2cUfp7D2yBH0l9p9S1CH/YVF2ZNf+zibVFs=; b=5xTViY0Zo+pFg54JcFUfem1nXxygUSpzcxnqK+bM1gh6GQdZwuGalyDKdfpskEz13j 8oF5jX7TgiafXhw5bw1QxiqoDfTODrOul1r1yFf761xH7ie0tsndgSCAeyQwXfHeZu9s pCGZeiUjn5E7s/4tUyjBZitRK34SYrM84wyRoBlRr0nlX8uRzw9ce1ugSzK2dnP4V9F8 ATNLGVdoSiCzYYjJVNEVA8pfGwEoZ0bxQgcAHC/w/boGpgWu6VxNbZ0FEY+puStLqJWR h9EmKDcXyYfluZu8it98tWN54LmUmBK/yRLuYVuKl9kvLvbZBFni4zRf2j0d+0LAUbJv FB9w== X-Gm-Message-State: AOAM530n6FkfvEZZWIXbw5YI9hkaATmnX0sAY2cHBceE/QVfyZsRBgdo pst5/HHymmBdDjOe/vOJPR0YN9LaQj8= X-Google-Smtp-Source: ABdhPJyODPs69dIFRFuo95Z4+x/90+1C3ltfB2u4qNW8fH2fovonaVxDD7+uXoi/KR/dASliXw4x9Q== X-Received: by 2002:a05:6214:2307:: with SMTP id gc7mr2208116qvb.77.1642038776643; Wed, 12 Jan 2022 17:52:56 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:56 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:50:09 -0300 Message-Id: <20220113015101.4-48-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113015101.4-1-jamrial@gmail.com> References: <20220113015101.4-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 047/281] derf: convert to new channel layout API X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- libavformat/derf.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavformat/derf.c b/libavformat/derf.c index d50a853194..9da7fc4f19 100644 --- a/libavformat/derf.c +++ b/libavformat/derf.c @@ -38,6 +38,7 @@ static int derf_probe(const AVProbeData *p) static int derf_read_header(AVFormatContext *s) { unsigned data_size; + int channels; AVIOContext *pb = s->pb; AVCodecParameters *par; AVStream *st; @@ -52,15 +53,12 @@ static int derf_read_header(AVFormatContext *s) par->codec_type = AVMEDIA_TYPE_AUDIO; par->codec_id = AV_CODEC_ID_DERF_DPCM; par->format = AV_SAMPLE_FMT_S16; - par->channels = avio_rl32(pb); - if (par->channels != 1 && par->channels != 2) + channels = avio_rl32(pb); + if (channels != 1 && channels != 2) return AVERROR_INVALIDDATA; - if (par->channels == 1) - par->channel_layout = AV_CH_LAYOUT_MONO; - else if (par->channels == 2) - par->channel_layout = AV_CH_LAYOUT_STEREO; + av_channel_layout_default(&par->ch_layout, channels); data_size = avio_rl32(pb); - st->duration = data_size / par->channels; + st->duration = data_size / channels; par->sample_rate = 22050; par->block_align = 1; -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".