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
5effa71e
Commit
5effa71e
authored
Sep 15, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactor.
parent
0a732338
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
69 deletions
+76
-69
research/miniaudio_engine.h
research/miniaudio_engine.h
+76
-69
No files found.
research/miniaudio_engine.h
View file @
5effa71e
...
@@ -8324,21 +8324,22 @@ static void ma_sound_mix_wait(ma_sound* pSound)
...
@@ -8324,21 +8324,22 @@ static void ma_sound_mix_wait(ma_sound* pSound)
}
}
}
}
static
void
ma_engine_mix_sound_internal
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
,
ma_uint64
frameCount
)
static
void
ma_engine_mix_sound
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
,
ma_uint64
frameCount
)
{
{
MA_ASSERT
(
pEngine
!=
NULL
);
MA_ASSERT
(
pGroup
!=
NULL
);
MA_ASSERT
(
pSound
!=
NULL
);
c89atomic_exchange_32
(
&
pSound
->
isMixing
,
MA_TRUE
);
/* This must be done before checking the isPlaying state. */
{
if
(
pSound
->
isPlaying
)
{
ma_result
result
=
MA_SUCCESS
;
ma_result
result
=
MA_SUCCESS
;
ma_uint64
framesProcessed
;
ma_uint64
framesProcessed
;
/* Don't do anything if we're not playing. */
if
(
pSound
->
isPlaying
==
MA_FALSE
)
{
return
;
}
/* If we're marked at the end we need to stop the sound and do nothing. */
/* If we're marked at the end we need to stop the sound and do nothing. */
if
(
!
pSound
->
atEnd
)
{
if
(
pSound
->
atEnd
)
{
ma_sound_stop_internal
(
pSound
);
return
;
}
/* If we're seeking, do so now before reading. */
/* If we're seeking, do so now before reading. */
if
(
pSound
->
seekTarget
!=
MA_SEEK_TARGET_NONE
)
{
if
(
pSound
->
seekTarget
!=
MA_SEEK_TARGET_NONE
)
{
pSound
->
seekTarget
=
MA_SEEK_TARGET_NONE
;
pSound
->
seekTarget
=
MA_SEEK_TARGET_NONE
;
...
@@ -8401,11 +8402,17 @@ static void ma_engine_mix_sound(ma_engine* pEngine, ma_sound_group* pGroup, ma_s
...
@@ -8401,11 +8402,17 @@ static void ma_engine_mix_sound(ma_engine* pEngine, ma_sound_group* pGroup, ma_s
ma_sound_stop_internal
(
pSound
);
ma_sound_stop_internal
(
pSound
);
}
}
}
}
}
else
{
}
/* The sound is at the end. Make sure it's marked as stopped. */
ma_sound_stop_internal
(
pSound
);
static
void
ma_engine_mix_sound
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
,
ma_uint64
frameCount
)
}
{
}
MA_ASSERT
(
pEngine
!=
NULL
);
MA_ASSERT
(
pGroup
!=
NULL
);
MA_ASSERT
(
pSound
!=
NULL
);
c89atomic_exchange_32
(
&
pSound
->
isMixing
,
MA_TRUE
);
/* This must be done before checking the isPlaying state. */
{
ma_engine_mix_sound_internal
(
pEngine
,
pGroup
,
pSound
,
frameCount
);
}
}
c89atomic_exchange_32
(
&
pSound
->
isMixing
,
MA_FALSE
);
c89atomic_exchange_32
(
&
pSound
->
isMixing
,
MA_FALSE
);
}
}
...
...
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