Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
38f2754e
Commit
38f2754e
authored
Jun 30, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation errors on 32-bit.
parent
dad754b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
miniaudio.h
miniaudio.h
+13
-8
No files found.
miniaudio.h
View file @
38f2754e
...
@@ -47467,7 +47467,7 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__raw(ma_decoder* pDecode
...
@@ -47467,7 +47467,7 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__raw(ma_decoder* pDecode
pRunningFramesOut = pFramesOut;
pRunningFramesOut = pFramesOut;
while (totalFramesRead < frameCount) {
while (totalFramesRead < frameCount) {
ma_uint64
framesReadThisIteration;
size_t
framesReadThisIteration;
ma_uint64 framesToReadThisIteration = (frameCount - totalFramesRead);
ma_uint64 framesToReadThisIteration = (frameCount - totalFramesRead);
if (framesToReadThisIteration > 0x7FFFFFFF/bpf) {
if (framesToReadThisIteration > 0x7FFFFFFF/bpf) {
framesToReadThisIteration = 0x7FFFFFFF/bpf;
framesToReadThisIteration = 0x7FFFFFFF/bpf;
...
@@ -47480,7 +47480,7 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__raw(ma_decoder* pDecode
...
@@ -47480,7 +47480,7 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__raw(ma_decoder* pDecode
} else {
} else {
/* We'll first try seeking. If this fails it means the end was reached and we'll to do a read-and-discard slow path to get the exact amount. */
/* We'll first try seeking. If this fails it means the end was reached and we'll to do a read-and-discard slow path to get the exact amount. */
if (ma_decoder_seek_bytes(pDecoder, (int)framesToReadThisIteration, ma_seek_origin_current) == MA_SUCCESS) {
if (ma_decoder_seek_bytes(pDecoder, (int)framesToReadThisIteration, ma_seek_origin_current) == MA_SUCCESS) {
framesReadThisIteration =
framesToReadThisIteration;
framesReadThisIteration =
(size_t)framesToReadThisIteration; /* Safe cast. */
} else {
} else {
/* Slow path. Need to fall back to a read-and-discard. This is required so we can get the exact number of remaining. */
/* Slow path. Need to fall back to a read-and-discard. This is required so we can get the exact number of remaining. */
ma_uint8 buffer[MA_DATA_CONVERTER_STACK_BUFFER_SIZE];
ma_uint8 buffer[MA_DATA_CONVERTER_STACK_BUFFER_SIZE];
...
@@ -47488,7 +47488,7 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__raw(ma_decoder* pDecode
...
@@ -47488,7 +47488,7 @@ static ma_uint64 ma_decoder_internal_on_read_pcm_frames__raw(ma_decoder* pDecode
framesReadThisIteration = 0;
framesReadThisIteration = 0;
while (framesReadThisIteration < framesToReadThisIteration) {
while (framesReadThisIteration < framesToReadThisIteration) {
ma_uint64
framesReadNow;
size_t
framesReadNow;
ma_uint64 framesToReadNow = framesToReadThisIteration - framesReadThisIteration;
ma_uint64 framesToReadNow = framesToReadThisIteration - framesReadThisIteration;
if (framesToReadNow > bufferCap) {
if (framesToReadNow > bufferCap) {
framesToReadNow = bufferCap;
framesToReadNow = bufferCap;
...
@@ -47960,19 +47960,24 @@ static size_t ma_decoder__on_read_memory(ma_decoder* pDecoder, void* pBufferOut,
...
@@ -47960,19 +47960,24 @@ static size_t ma_decoder__on_read_memory(ma_decoder* pDecoder, void* pBufferOut,
static ma_bool32 ma_decoder__on_seek_memory(ma_decoder* pDecoder, ma_int64 byteOffset, ma_seek_origin origin)
static ma_bool32 ma_decoder__on_seek_memory(ma_decoder* pDecoder, ma_int64 byteOffset, ma_seek_origin origin)
{
{
if (byteOffset > MA_SIZE_MAX) {
return MA_FALSE; /* Too far. */
}
if (origin == ma_seek_origin_current) {
if (origin == ma_seek_origin_current) {
if (byteOffset > 0) {
if (byteOffset > 0) {
if (pDecoder->data.memory.currentReadPos + byteOffset > pDecoder->data.memory.dataSize) {
if (pDecoder->data.memory.currentReadPos + byteOffset > pDecoder->data.memory.dataSize) {
byteOffset = (ma_int64)(pDecoder->data.memory.dataSize - pDecoder->data.memory.currentReadPos); /* Trying to seek too far forward. */
byteOffset = (ma_int64)(pDecoder->data.memory.dataSize - pDecoder->data.memory.currentReadPos); /* Trying to seek too far forward. */
}
}
pDecoder->data.memory.currentReadPos += (size_t)byteOffset;
} else {
} else {
if (pDecoder->data.memory.currentReadPos < (size_t)-byteOffset) {
if (pDecoder->data.memory.currentReadPos < (size_t)-byteOffset) {
byteOffset = -(ma_int64)pDecoder->data.memory.currentReadPos; /* Trying to seek too far backwards. */
byteOffset = -(ma_int64)pDecoder->data.memory.currentReadPos; /* Trying to seek too far backwards. */
}
}
}
/* This will never underflow thanks to the clamps above. */
pDecoder->data.memory.currentReadPos -= (size_t)-byteOffset;
pDecoder->data.memory.currentReadPos += byteOffset;
}
} else {
} else {
if (origin == ma_seek_origin_end) {
if (origin == ma_seek_origin_end) {
if (byteOffset < 0) {
if (byteOffset < 0) {
...
@@ -47982,11 +47987,11 @@ static ma_bool32 ma_decoder__on_seek_memory(ma_decoder* pDecoder, ma_int64 byteO
...
@@ -47982,11 +47987,11 @@ static ma_bool32 ma_decoder__on_seek_memory(ma_decoder* pDecoder, ma_int64 byteO
if (byteOffset > (ma_int64)pDecoder->data.memory.dataSize) {
if (byteOffset > (ma_int64)pDecoder->data.memory.dataSize) {
pDecoder->data.memory.currentReadPos = 0; /* Trying to seek too far back. */
pDecoder->data.memory.currentReadPos = 0; /* Trying to seek too far back. */
} else {
} else {
pDecoder->data.memory.currentReadPos = pDecoder->data.memory.dataSize - byteOffset;
pDecoder->data.memory.currentReadPos = pDecoder->data.memory.dataSize -
(size_t)
byteOffset;
}
}
} else {
} else {
if ((size_t)byteOffset <= pDecoder->data.memory.dataSize) {
if ((size_t)byteOffset <= pDecoder->data.memory.dataSize) {
pDecoder->data.memory.currentReadPos = byteOffset;
pDecoder->data.memory.currentReadPos =
(size_t)
byteOffset;
} else {
} else {
pDecoder->data.memory.currentReadPos = pDecoder->data.memory.dataSize; /* Trying to seek too far forward. */
pDecoder->data.memory.currentReadPos = pDecoder->data.memory.dataSize; /* Trying to seek too far forward. */
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment