From 93473b29f7cdd411ef1acc2f3525e55b5a5f349e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=B8=B4=E9=A3=8E?= Date: Mon, 12 May 2025 10:46:08 +0800 Subject: [PATCH] add u64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 杨临风 --- .../samples/USB Device 0x46d:0x9a4--USB Mixer | 5 ----- src/pulsecore/modargs.c | 14 ++++++++++++++ src/pulsecore/modargs.h | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) delete mode 100644 src/modules/alsa/mixer/samples/USB Device 0x46d:0x9a4--USB Mixer diff --git a/src/modules/alsa/mixer/samples/USB Device 0x46d:0x9a4--USB Mixer b/src/modules/alsa/mixer/samples/USB Device 0x46d:0x9a4--USB Mixer deleted file mode 100644 index 783f826fc..000000000 --- a/src/modules/alsa/mixer/samples/USB Device 0x46d:0x9a4--USB Mixer +++ /dev/null @@ -1,5 +0,0 @@ -Simple mixer control 'Mic',0 - Capabilities: cvolume cvolume-joined cswitch cswitch-joined - Capture channels: Mono - Limits: Capture 0 - 3072 - Mono: Capture 1536 [50%] [23.00dB] [on] diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c index a707f6c8d..04cda5684 100644 --- a/src/pulsecore/modargs.c +++ b/src/pulsecore/modargs.c @@ -342,6 +342,20 @@ int pa_modargs_get_value_s32(pa_modargs *ma, const char *key, int32_t *value) { return 0; } +int pa_modargs_get_value_u64(pa_modargs *ma, const char *key, uint64_t *value) { + const char *v; + + pa_assert(value); + + if (!(v = pa_modargs_get_value(ma, key, NULL))) + return 0; + + if (pa_atou64(v, value) < 0) + return -1; + + return 0; +} + int pa_modargs_get_value_boolean(pa_modargs *ma, const char *key, bool *value) { const char *v; int r; diff --git a/src/pulsecore/modargs.h b/src/pulsecore/modargs.h index abb16747d..416f346b9 100644 --- a/src/pulsecore/modargs.h +++ b/src/pulsecore/modargs.h @@ -46,6 +46,7 @@ const char *pa_modargs_get_value(pa_modargs *ma, const char *key, const char *de * was not specified, *value remains unchanged. */ int pa_modargs_get_value_u32(pa_modargs *ma, const char *key, uint32_t *value); int pa_modargs_get_value_s32(pa_modargs *ma, const char *key, int32_t *value); +int pa_modargs_get_value_u64(pa_modargs *ma, const char *key, uint64_t *value); int pa_modargs_get_value_boolean(pa_modargs *ma, const char *key, bool *value); /* Return a module argument as double value in *value. If the argument was not -- Gitee