From patchwork Sun Jun 21 08:53:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 20532 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 0B43944B677 for ; Sun, 21 Jun 2020 11:54:04 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CDAF568B675; Sun, 21 Jun 2020 11:54:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DFFB968B668 for ; Sun, 21 Jun 2020 11:53:57 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id v3so6209398wrc.1 for ; Sun, 21 Jun 2020 01:53:57 -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:mime-version :content-transfer-encoding; bh=yEFm9CfkfisL4jMaSgnV1T6m5POSgDwVWuzdS2e0lH8=; b=H85Rh1BElwHzZ6JTem4h44u1NfK8CkEbYt+JSi53+F3yXdow5Or+8yRJCQZQvF1Xmc DEDx2oD2EpCh2MusiYx1n4Rre5H0lzsF4M481GcJNkZszO/2Uq9kL4QntiFQaYFw0mZv lPc4haOx1059olFM37fhc27fy0+At1DLQ+wjqfsclq1vgRW5Wmivenb2noduCpHAPdX3 9GCoIHLsjq7fvjrIIvIkGIAp5cnsECF5+0TGM2AoKvQ4C9G7gTdVNTRzB54BCQbbke34 VAWmwF5i6T8IYqOmjDqXXCPvosB21aoxXMx3pxlkdMiemgV6D2uALgNyuKJXlK873mB8 /7uw== 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:mime-version :content-transfer-encoding; bh=yEFm9CfkfisL4jMaSgnV1T6m5POSgDwVWuzdS2e0lH8=; b=GRP+9nTDCtc0UH308mwiyrp49zMq0/2xbnhGoYZ8SLygQa0DYAcOVAz7cJRwHpJXzT flzPJo9s+l2TjRFx7QYGuf9GzZH5PcfsqaC2U1ln89G1Cc1zSEzcJJOIzY0qqIm704ZO rGK1BId1Z6bNQycZO2giUL7l7b9KE8Phy6+NmhkY9pq9EsfHb7F3hGkRgyLDpjG5AYda MU5sQocbFIXnXwemwdzUZCMpIlmV0MW/9+SMRBnT2J/iUDNBw6fPwWtmuQxlj/QleKFn ZTcI2ji/0g4m0m6jozKThyms302K7EIMuaejLfNBdtChxusv9iCvZxJ/HdCZ+cbfpBFP sEnQ== X-Gm-Message-State: AOAM531eGS+wOUZMaz3MDww1uuAVYu6NN40STqwKfOxRrGtclSGZLFpe ijerdALqdY8hCl5LuUIGq+7dvbCc X-Google-Smtp-Source: ABdhPJzrMg3PMw4NtP6Da+SLu0M60Za0JsGDLnXYomZFpRvMEEFnycMx6/OFCmCLpJ/OXqRUmfpVmw== X-Received: by 2002:adf:dc42:: with SMTP id m2mr13824312wrj.342.1592729637134; Sun, 21 Jun 2020 01:53:57 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id b143sm12616054wme.20.2020.06.21.01.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jun 2020 01:53:56 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 21 Jun 2020 10:53:45 +0200 Message-Id: <20200621085349.22370-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/nellymoserdec: Don't use invalid AVPacketSideDataType 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Commits 957a593cd95b15a5dcb2f50306fbac59f09d8e9e and 11828b8885cc1d87ffc7b1b4bbe642ce9720b194 made the flv demuxer export a certain flag as side data to be used by the nellymoser decoder for mid-stream sample rate changes. It used a custom side data type 'F' that was never officially documented. Yet since 2215c39e94e01f57b3191a29e0e51d7e230daf49 (merged in commit 52c522c72090233edeeb0486a9bd8bee925a710a) this information is exported via the properly documented AV_PKT_DATA_PARAM_CHANGE side data. The merge commit therefore stopped exporting the 'F' sidedata; yet the changes in the Nellymoser decoder (which are now dead code (and would become dangerous if lots of new side data types were added)) have not been removed. This commit does this. Signed-off-by: Andreas Rheinhardt --- libavcodec/nellymoserdec.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index b0deb79cf5..d667d9ce79 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -143,7 +143,6 @@ static int decode_tag(AVCodecContext *avctx, void *data, { AVFrame *frame = data; const uint8_t *buf = avpkt->data; - const uint8_t *side=av_packet_get_side_data(avpkt, 'F', NULL); int buf_size = avpkt->size; NellyMoserDecodeContext *s = avctx->priv_data; int blocks, i, ret; @@ -160,15 +159,6 @@ static int decode_tag(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_WARNING, "Leftover bytes: %d.\n", buf_size % NELLY_BLOCK_LEN); } - /* Normal numbers of blocks for sample rates: - * 8000 Hz - 1 - * 11025 Hz - 2 - * 16000 Hz - 3 - * 22050 Hz - 4 - * 44100 Hz - 8 - */ - if(side && blocks>1 && avctx->sample_rate%11025==0 && (1<<((side[0]>>2)&3)) == blocks) - avctx->sample_rate= 11025*(blocks/2); /* get output buffer */ frame->nb_samples = NELLY_SAMPLES * blocks;