diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
commit | 9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch) | |
tree | 2784370cda9bbf2da9114d70f05399c0b229d28c /plugins/codecs/l16_mono | |
parent | Adding debian version 4.2.6-1. (diff) | |
download | wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/codecs/l16_mono')
-rw-r--r-- | plugins/codecs/l16_mono/README | 2 | ||||
-rw-r--r-- | plugins/codecs/l16_mono/l16decode.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/codecs/l16_mono/README b/plugins/codecs/l16_mono/README index 993730a4..8faa8e1c 100644 --- a/plugins/codecs/l16_mono/README +++ b/plugins/codecs/l16_mono/README @@ -1,3 +1,3 @@ This codec plugin serves a dual purpose. -First it is to add L16 codec suppport to Wireshark. +First it is to add L16 codec support to Wireshark. Second it is an illustration of a basic codec plugin module. diff --git a/plugins/codecs/l16_mono/l16decode.c b/plugins/codecs/l16_mono/l16decode.c index 12994cfc..6ef292f4 100644 --- a/plugins/codecs/l16_mono/l16decode.c +++ b/plugins/codecs/l16_mono/l16decode.c @@ -70,8 +70,8 @@ codec_l16_decode(codec_context_t *ctx _U_, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) { - const guint16 *dataIn = (const guint16 *)inputBytes; - guint16 *dataOut = (gint16 *)outputSamples; + const uint16_t *dataIn = (const uint16_t *)inputBytes; + uint16_t *dataOut = (int16_t *)outputSamples; size_t i; unsigned channels = ctx->channels ? ctx->channels : 1; if (!outputSamples || !outputSamplesSize) @@ -82,11 +82,11 @@ codec_l16_decode(codec_context_t *ctx _U_, /* Downmix to mono. No worries about overflow because tmp is 32 bit. */ for (i=0; i<inputBytesSize/(2 * channels); i++) { - gint32 tmp = 0; + int32_t tmp = 0; for (unsigned j=0; j < channels; j++) { - tmp += (gint16)g_ntohs(dataIn[channels*i + j]); + tmp += (int16_t)g_ntohs(dataIn[channels*i + j]); } - dataOut[i] = (gint16)(tmp / channels); + dataOut[i] = (int16_t)(tmp / channels); } *outputSamplesSize = inputBytesSize/channels; |