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
1051ab9a
Commit
1051ab9a
authored
Apr 21, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors with incorrectly reported frame counts from data conversion.
parent
39d44ae2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
mini_al.h
mini_al.h
+40
-4
No files found.
mini_al.h
View file @
1051ab9a
...
...
@@ -17343,6 +17343,10 @@ mal_uint64 mal_format_converter_read(mal_format_converter* pConverter, mal_uint6
totalFramesRead += framesJustRead;
pNextFramesOut += framesJustRead * frameSizeOut;
if (framesJustRead < framesToReadRightNow) {
break;
}
}
} else {
// Conversion required.
...
...
@@ -17367,6 +17371,10 @@ mal_uint64 mal_format_converter_read(mal_format_converter* pConverter, mal_uint6
totalFramesRead += framesJustRead;
pNextFramesOut += framesJustRead * frameSizeOut;
if (framesJustRead < framesToReadRightNow) {
break;
}
}
}
} else {
...
...
@@ -17421,6 +17429,10 @@ mal_uint64 mal_format_converter_read(mal_format_converter* pConverter, mal_uint6
totalFramesRead += framesJustRead;
pNextFramesOut += framesJustRead * frameSizeOut;
if (framesJustRead < framesToReadRightNow) {
break;
}
}
}
...
...
@@ -17480,6 +17492,10 @@ mal_uint64 mal_format_converter_read_deinterleaved(mal_format_converter* pConver
for (mal_uint32 iChannel = 0; iChannel < pConverter->config.channels; ++iChannel) {
ppNextSamplesOut[iChannel] += framesJustRead * sampleSizeOut;
}
if (framesJustRead < framesToReadRightNow) {
break;
}
}
} else {
// Input data is deinterleaved.
...
...
@@ -17501,6 +17517,10 @@ mal_uint64 mal_format_converter_read_deinterleaved(mal_format_converter* pConver
for (mal_uint32 iChannel = 0; iChannel < pConverter->config.channels; ++iChannel) {
ppNextSamplesOut[iChannel] += framesJustRead * sampleSizeOut;
}
if (framesJustRead < framesToReadRightNow) {
break;
}
}
} else {
// Conversion required.
...
...
@@ -17531,6 +17551,10 @@ mal_uint64 mal_format_converter_read_deinterleaved(mal_format_converter* pConver
}
totalFramesRead += framesJustRead;
if (framesJustRead < framesToReadRightNow) {
break;
}
}
}
}
...
...
@@ -18114,6 +18138,10 @@ mal_uint64 mal_channel_router_read_deinterleaved(mal_channel_router* pRouter, ma
for (mal_uint32 iChannel = 0; iChannel < pRouter->config.channelsOut; ++iChannel) {
ppNextSamplesOut[iChannel] += framesJustRead;
}
if (framesJustRead < framesToReadRightNow) {
break;
}
}
}
}
...
...
@@ -18152,6 +18180,10 @@ mal_uint64 mal_channel_router_read_deinterleaved(mal_channel_router* pRouter, ma
ppNextSamplesOut[iChannel] += framesJustRead;
}
}
if (framesJustRead < framesToReadRightNow) {
break;
}
}
return totalFramesRead;
...
...
@@ -18303,14 +18335,18 @@ mal_uint64 mal_src_read_deinterleaved__passthrough(mal_src* pSRC, mal_uint64 fra
framesToReadRightNow = 0xFFFFFFFF;
}
mal_uint32 framesRead = (mal_uint32)pSRC->config.onReadDeinterleaved(pSRC, (mal_uint32)framesToReadRightNow, (void**)ppNextSamplesOut, pUserData);
if (framesRead == 0) {
mal_uint32 frames
Just
Read = (mal_uint32)pSRC->config.onReadDeinterleaved(pSRC, (mal_uint32)framesToReadRightNow, (void**)ppNextSamplesOut, pUserData);
if (frames
Just
Read == 0) {
break;
}
totalFramesRead += framesRead;
totalFramesRead += frames
Just
Read;
for (mal_uint32 iChannel = 0; iChannel < pSRC->config.channels; ++iChannel) {
ppNextSamplesOut[iChannel] += framesRead;
ppNextSamplesOut[iChannel] += framesJustRead;
}
if (framesJustRead < framesToReadRightNow) {
break;
}
}
...
...
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