Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 05/12] avcodec/aac/aacdec: Move channel number check out of init_dsp()
Date: Mon,  6 May 2024 14:14:27 +0200
Message-ID: <GV1P250MB07378D68558B0289EAC726728F1C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <GV1P250MB0737A4218AC17DD0A60E579C8F1C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>

Also move initializing random_state.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/aac/aacdec.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c
index f6a7266123..a78a669602 100644
--- a/libavcodec/aac/aacdec.c
+++ b/libavcodec/aac/aacdec.c
@@ -1159,13 +1159,6 @@ static av_cold int init_dsp(AVCodecContext *avctx)
     const float *const scalep = is_fixed ? &scale_fixed : &scale_float;
     enum AVTXType tx_type = is_fixed ? AV_TX_INT32_MDCT : AV_TX_FLOAT_MDCT;
 
-    if (avctx->ch_layout.nb_channels > MAX_CHANNELS) {
-        av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ac->random_state = 0x1f2e3d4c;
-
 #define MDCT_INIT(s, fn, len, sval)                                          \
     scale_fixed = (sval) * 128.0f;                                           \
     scale_float = (sval) / 32768.0f;                                         \
@@ -1248,6 +1241,13 @@ static av_cold int aac_decode_init_internal(AVCodecContext *avctx)
         }
     }
 
+    if (avctx->ch_layout.nb_channels > MAX_CHANNELS) {
+        av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
+        return AVERROR_INVALIDDATA;
+    }
+
+    ac->random_state = 0x1f2e3d4c;
+
     return init_dsp(avctx);
 }
 
-- 
2.40.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".

  parent reply	other threads:[~2024-05-06 12:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06  9:29 [FFmpeg-devel] [PATCH 1/3] avcodec/aactab: Provide ff_ltp_coef, ff_tns_tmp2_map unconditionally Andreas Rheinhardt
2024-05-06  9:30 ` [FFmpeg-devel] [PATCH 2/3] avcodec/aacsbr: Fix type mismatch Andreas Rheinhardt
2024-05-06 17:54   ` Lynne
2024-05-06  9:30 ` [FFmpeg-devel] [PATCH 3/3] avcodec/aac/aacdec: Fix linking errors with only one decoder enabled Andreas Rheinhardt
2024-05-06 14:03   ` [FFmpeg-devel] [PATCH v2 3/12] " Andreas Rheinhardt
2024-05-06 17:53   ` [FFmpeg-devel] [PATCH 3/3] " Lynne
2024-05-06 19:39     ` Andreas Rheinhardt
2024-05-06 20:00       ` Lynne
2024-05-06 20:08         ` Andreas Rheinhardt
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 04/12] avcodec/aac/aacdec: Remove unnecessary ff_thread_once() Andreas Rheinhardt
2024-05-06 12:14 ` Andreas Rheinhardt [this message]
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 06/12] avcodec/aac/aacdec: Avoid branch to set sample_fmt Andreas Rheinhardt
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 07/12] avcodec/aac/aacdec_float: Call ff_aac_float_common_init() only once Andreas Rheinhardt
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 08/12] avcodec/aac/aacdec_(fixed|float): Avoid AAC_RENAME, INTFLOAT Andreas Rheinhardt
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 09/12] avcodec/aac/aacdec: Mark flush as cold Andreas Rheinhardt
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 10/12] avcodec/aac/aacdec: Avoid compiling latm decoder if disabled Andreas Rheinhardt
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 11/12] avcodec/aac/aacdec: Move init functions to aacdec_fixed/float Andreas Rheinhardt
2024-05-06 12:14 ` [FFmpeg-devel] [PATCH 12/12] avcodec/aac/aacdec_(fixed|float): Set AACDecDSP, AACDecProc directly Andreas Rheinhardt
2024-05-06 17:59   ` Lynne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=GV1P250MB07378D68558B0289EAC726728F1C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git