Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108321757
D48617.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48617.diff
View Options
diff --git a/tests/sys/sound/pcm_read_write.c b/tests/sys/sound/pcm_read_write.c
--- a/tests/sys/sound/pcm_read_write.c
+++ b/tests/sys/sound/pcm_read_write.c
@@ -95,8 +95,14 @@
static intpcm_t
local_calc_limit(intpcm_t value, int val_bits)
{
- /* Avoid implementation defined behavior. */
- if (sizeof(intpcm32_t) == 32 && val_bits == 32)
+ /*
+ * When intpcm32_t is defined to be 32bit, calculations for mixing and
+ * volume changes use 32bit integers instead of 64bit. To get some
+ * headroom for calculations, 32bit sample values are restricted to
+ * 24bit magnitude in that case. Also avoid implementation defined
+ * behavior here.
+ */
+ if (sizeof(intpcm32_t) == (32 / 8) && val_bits == 32)
/* Divide instead of right shift (value may be negative). */
return (value / (1 << 8));
return value;
@@ -456,7 +462,7 @@
}
local_pcm_write_calc(dst, value, test->format);
ATF_CHECK_MSG(memcmp(dst, expected, sizeof(dst)) == 0,
- "pcm_write[\"%s\"].value: "
+ "pcm_write[\"%s\"].calc: "
"expected={0x%02x, 0x%02x, 0x%02x, 0x%02x}, "
"result={0x%02x, 0x%02x, 0x%02x, 0x%02x}, ", test->label,
expected[0], expected[1], expected[2], expected[3],
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 8:43 PM (12 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16073819
Default Alt Text
D48617.diff (1 KB)
Attached To
Mode
D48617: sound tests: Fix 32bit calculation detection in pcm_read_write
Attached
Detach File
Event Timeline
Log In to Comment