Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] swresample/resample, soxr_resample: Use designated initializers (PR #20508)
@ 2025-09-12 20:24 mkver via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: mkver via ffmpeg-devel @ 2025-09-12 20:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: mkver

PR #20508 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20508
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20508.patch


>From 1c050139a9ae49bd147039975d6d7a67ee70ee66 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Fri, 12 Sep 2025 22:22:22 +0200
Subject: [PATCH] swresample/resample, soxr_resample: Use designated
 initializers

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libswresample/resample.c      | 18 +++++++++---------
 libswresample/soxr_resample.c | 11 ++++++++---
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 2b8571bbd6..16d48e93da 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -501,13 +501,13 @@ static int invert_initial_buffer(ResampleContext *c, AudioData *dst, const Audio
     return FFMAX(res, 0);
 }
 
-struct Resampler const swri_resampler={
-  resample_init,
-  resample_free,
-  multiple_resample,
-  resample_flush,
-  set_compensation,
-  get_delay,
-  invert_initial_buffer,
-  get_out_samples,
+const struct Resampler swri_resampler = {
+    .init                  = resample_init,
+    .free                  = resample_free,
+    .multiple_resample     = multiple_resample,
+    .flush                 = resample_flush,
+    .set_compensation      = set_compensation,
+    .get_delay             = get_delay,
+    .invert_initial_buffer = invert_initial_buffer,
+    .get_out_samples       = get_out_samples,
 };
diff --git a/libswresample/soxr_resample.c b/libswresample/soxr_resample.c
index 00d79878ca..cc5b4db5d4 100644
--- a/libswresample/soxr_resample.c
+++ b/libswresample/soxr_resample.c
@@ -123,7 +123,12 @@ static int64_t get_out_samples(struct SwrContext *s, int in_samples){
     return (int64_t)(out_samples + delayed_samples + 1 + .5);
 }
 
-struct Resampler const swri_soxr_resampler={
-    create, destroy, process, flush, NULL /* set_compensation */, get_delay,
-    invert_initial_buffer, get_out_samples
+const struct Resampler swri_soxr_resampler = {
+    .init                  = create,
+    .free                  = destroy,
+    .multiple_resample     = process,
+    .flush                 = flush,
+    .get_delay             = get_delay,
+    .invert_initial_buffer = invert_initial_buffer,
+    .get_out_samples       = get_out_samples,
 };
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-12 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-12 20:24 [FFmpeg-devel] [PATCH] swresample/resample, soxr_resample: Use designated initializers (PR #20508) mkver via ffmpeg-devel

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