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
6ec9a1c1
Commit
6ec9a1c1
authored
Jul 01, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code restructure.
parent
9f446079
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
research/miniaudio_engine.h
research/miniaudio_engine.h
+17
-13
No files found.
research/miniaudio_engine.h
View file @
6ec9a1c1
...
@@ -7000,20 +7000,29 @@ MA_API void ma_resource_manager_uninit(ma_resource_manager* pResourceManager)
...
@@ -7000,20 +7000,29 @@ MA_API void ma_resource_manager_uninit(ma_resource_manager* pResourceManager)
}
}
static
ma_
result
ma_resource_manager__init_decoder
(
ma_resource_manager
*
pResourceManager
,
const
char
*
pFilePath
,
const
wchar_t
*
pFilePathW
,
ma_decoder
*
pDecod
er
)
static
ma_
decoder_config
ma_resource_manager__init_decoder_config
(
ma_resource_manager
*
pResourceManag
er
)
{
{
ma_decoder_config
config
;
ma_decoder_config
config
;
MA_ASSERT
(
pResourceManager
!=
NULL
);
MA_ASSERT
(
pFilePath
!=
NULL
||
pFilePathW
!=
NULL
);
MA_ASSERT
(
pDecoder
!=
NULL
);
config
=
ma_decoder_config_init
(
pResourceManager
->
config
.
decodedFormat
,
pResourceManager
->
config
.
decodedChannels
,
pResourceManager
->
config
.
decodedSampleRate
);
config
=
ma_decoder_config_init
(
pResourceManager
->
config
.
decodedFormat
,
pResourceManager
->
config
.
decodedChannels
,
pResourceManager
->
config
.
decodedSampleRate
);
config
.
allocationCallbacks
=
pResourceManager
->
config
.
allocationCallbacks
;
config
.
allocationCallbacks
=
pResourceManager
->
config
.
allocationCallbacks
;
config
.
ppCustomBackendVTables
=
pResourceManager
->
config
.
ppCustomDecodingBackendVTables
;
config
.
ppCustomBackendVTables
=
pResourceManager
->
config
.
ppCustomDecodingBackendVTables
;
config
.
customBackendVTableCount
=
pResourceManager
->
config
.
customDecodingBackendVTableCount
;
config
.
customBackendVTableCount
=
pResourceManager
->
config
.
customDecodingBackendVTableCount
;
config
.
pCustomBackendUserData
=
pResourceManager
->
config
.
pCustomDecodingBackendUserData
;
config
.
pCustomBackendUserData
=
pResourceManager
->
config
.
pCustomDecodingBackendUserData
;
return
config
;
}
static
ma_result
ma_resource_manager__init_decoder
(
ma_resource_manager
*
pResourceManager
,
const
char
*
pFilePath
,
const
wchar_t
*
pFilePathW
,
ma_decoder
*
pDecoder
)
{
ma_decoder_config
config
;
MA_ASSERT
(
pResourceManager
!=
NULL
);
MA_ASSERT
(
pFilePath
!=
NULL
||
pFilePathW
!=
NULL
);
MA_ASSERT
(
pDecoder
!=
NULL
);
config
=
ma_resource_manager__init_decoder_config
(
pResourceManager
);
if
(
pFilePath
!=
NULL
)
{
if
(
pFilePath
!=
NULL
)
{
return
ma_decoder_init_vfs
(
pResourceManager
->
config
.
pVFS
,
pFilePath
,
&
config
,
pDecoder
);
return
ma_decoder_init_vfs
(
pResourceManager
->
config
.
pVFS
,
pFilePath
,
&
config
,
pDecoder
);
}
else
{
}
else
{
...
@@ -7043,14 +7052,9 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana
...
@@ -7043,14 +7052,9 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana
{
{
case
ma_resource_manager_data_supply_type_encoded
:
/* Connector is a decoder. */
case
ma_resource_manager_data_supply_type_encoded
:
/* Connector is a decoder. */
{
{
ma_decoder_config
configOut
;
ma_decoder_config
config
;
configOut
=
ma_decoder_config_init
(
pDataBuffer
->
pResourceManager
->
config
.
decodedFormat
,
pDataBuffer
->
pResourceManager
->
config
.
decodedChannels
,
pDataBuffer
->
pResourceManager
->
config
.
decodedSampleRate
);
config
=
ma_resource_manager__init_decoder_config
(
pDataBuffer
->
pResourceManager
);
configOut
.
allocationCallbacks
=
pDataBuffer
->
pResourceManager
->
config
.
allocationCallbacks
;
result
=
ma_decoder_init_memory
(
pDataBuffer
->
pNode
->
data
.
encoded
.
pData
,
pDataBuffer
->
pNode
->
data
.
encoded
.
sizeInBytes
,
&
config
,
&
pDataBuffer
->
connector
.
decoder
);
configOut
.
ppCustomBackendVTables
=
pDataBuffer
->
pResourceManager
->
config
.
ppCustomDecodingBackendVTables
;
configOut
.
customBackendVTableCount
=
pDataBuffer
->
pResourceManager
->
config
.
customDecodingBackendVTableCount
;
configOut
.
pCustomBackendUserData
=
pDataBuffer
->
pResourceManager
->
config
.
pCustomDecodingBackendUserData
;
result
=
ma_decoder_init_memory
(
pDataBuffer
->
pNode
->
data
.
encoded
.
pData
,
pDataBuffer
->
pNode
->
data
.
encoded
.
sizeInBytes
,
&
configOut
,
&
pDataBuffer
->
connector
.
decoder
);
}
break
;
}
break
;
case
ma_resource_manager_data_supply_type_decoded
:
/* Connector is an audio buffer. */
case
ma_resource_manager_data_supply_type_decoded
:
/* Connector is an audio buffer. */
...
...
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