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
f22ad849
Commit
f22ad849
authored
Jan 18, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ma_resampler_uninit().
parent
7b27cda7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
research/ma_resampler.h
research/ma_resampler.h
+27
-3
No files found.
research/ma_resampler.h
View file @
f22ad849
...
...
@@ -38,8 +38,6 @@ ma_resampler_config ma_resampler_config_init(ma_format format, ma_uint32 channel
typedef
struct
{
ma_resampler_config
config
;
float
timeX
;
/* Input time. */
float
timeY
;
/* Output time. */
union
{
struct
...
...
@@ -66,6 +64,11 @@ Initializes a new resampler object from a config.
*/
ma_result
ma_resampler_init
(
const
ma_resampler_config
*
pConfig
,
ma_resampler
*
pResampler
);
/*
Uninitializes a resampler.
*/
void
ma_resampler_uninit
(
ma_resampler
*
pResampler
);
/*
Converts the given input data.
...
...
@@ -186,6 +189,19 @@ ma_result ma_resampler_init(const ma_resampler_config* pConfig, ma_resampler* pR
return
MA_SUCCESS
;
}
void
ma_resampler_uninit
(
ma_resampler
*
pResampler
)
{
if
(
pResampler
==
NULL
)
{
return
;
}
#if defined(MA_HAS_SPEEX_RESAMPLER)
if
(
pResampler
->
config
.
algorithm
==
ma_resample_algorithm_speex
)
{
speex_resampler_destroy
(
pResampler
->
state
.
pSpeex
);
}
#endif
}
static
ma_result
ma_resampler_process__seek__linear
(
ma_resampler
*
pResampler
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
{
MA_ASSERT
(
pResampler
!=
NULL
);
...
...
@@ -398,6 +414,7 @@ static ma_result ma_resampler_process__read__linear_lpf(ma_resampler* pResampler
}
}
#if defined(MA_HAS_SPEEX_RESAMPLER)
static
ma_result
ma_resampler_process__read__speex
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
{
/* To do this we just read using the non-filtered linear pipeline, and then do an in-place filter on the output buffer. */
...
...
@@ -461,6 +478,7 @@ static ma_result ma_resampler_process__read__speex(ma_resampler* pResampler, voi
return
MA_SUCCESS
;
}
#endif
static
ma_result
ma_resampler_process__read
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
{
...
...
@@ -491,11 +509,17 @@ static ma_result ma_resampler_process__read(ma_resampler* pResampler, void* pFra
case
ma_resample_algorithm_speex
:
{
#if defined(MA_HAS_SPEEX_RESAMPLER)
return
ma_resampler_process__read__speex
(
pResampler
,
pFramesOut
,
pFrameCountOut
,
pFramesIn
,
pFrameCountIn
);
#endif
}
break
;
default:
return
MA_INVALID_ARGS
;
/* Should never hit this. */
}
/* Should never get here. */
MA_ASSERT
(
MA_FALSE
);
return
MA_INVALID_ARGS
;
}
ma_result
ma_resampler_process
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
...
...
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