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
fe85a132
Commit
fe85a132
authored
Aug 15, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ma_decoder_get_cursor_in_pcm_frames().
parent
eea8ea9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
+29
-13
miniaudio.h
miniaudio.h
+28
-12
research/ma_engine.h
research/ma_engine.h
+1
-1
No files found.
miniaudio.h
View file @
fe85a132
/*
/*
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
miniaudio - v0.10.1
6 - 2020-08-14
miniaudio - v0.10.1
7 - TBD
David Reid - davidreidsoftware@gmail.com
David Reid - davidreidsoftware@gmail.com
...
@@ -1423,7 +1423,7 @@ extern "C" {
...
@@ -1423,7 +1423,7 @@ extern "C" {
#define MA_VERSION_MAJOR 0
#define MA_VERSION_MAJOR 0
#define MA_VERSION_MINOR 10
#define MA_VERSION_MINOR 10
#define MA_VERSION_REVISION 1
6
#define MA_VERSION_REVISION 1
7
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER) && !defined(__clang__)
...
@@ -5486,6 +5486,11 @@ MA_API ma_result ma_decoder_init_file_vorbis_w(const wchar_t* pFilePath, const m
...
@@ -5486,6 +5486,11 @@ MA_API ma_result ma_decoder_init_file_vorbis_w(const wchar_t* pFilePath, const m
MA_API ma_result ma_decoder_uninit(ma_decoder* pDecoder);
MA_API ma_result ma_decoder_uninit(ma_decoder* pDecoder);
/*
Retrieves the current position of the read cursor in PCM frames.
*/
MA_API ma_result ma_decoder_get_cursor_in_pcm_frames(ma_decoder* pDecoder, ma_uint64* pCursor);
/*
/*
Retrieves the length of the decoder in PCM frames.
Retrieves the length of the decoder in PCM frames.
...
@@ -44499,15 +44504,6 @@ static ma_result ma_decoder__data_source_on_get_data_format(ma_data_source* pDat
...
@@ -44499,15 +44504,6 @@ static ma_result ma_decoder__data_source_on_get_data_format(ma_data_source* pDat
return MA_SUCCESS;
return MA_SUCCESS;
}
}
static ma_result ma_decoder__data_source_on_get_cursor(ma_data_source* pDataSource, ma_uint64* pCursor)
{
ma_decoder* pDecoder = (ma_decoder*)pDataSource;
*pCursor = pDecoder->readPointerInPCMFrames;
return MA_SUCCESS;
}
static ma_result ma_decoder__data_source_on_get_length(ma_data_source* pDataSource, ma_uint64* pLength)
static ma_result ma_decoder__data_source_on_get_length(ma_data_source* pDataSource, ma_uint64* pLength)
{
{
ma_decoder* pDecoder = (ma_decoder*)pDataSource;
ma_decoder* pDecoder = (ma_decoder*)pDataSource;
...
@@ -44539,7 +44535,7 @@ static ma_result ma_decoder__preinit(ma_decoder_read_proc onRead, ma_decoder_see
...
@@ -44539,7 +44535,7 @@ static ma_result ma_decoder__preinit(ma_decoder_read_proc onRead, ma_decoder_see
pDecoder->ds.onRead = ma_decoder__data_source_on_read;
pDecoder->ds.onRead = ma_decoder__data_source_on_read;
pDecoder->ds.onSeek = ma_decoder__data_source_on_seek;
pDecoder->ds.onSeek = ma_decoder__data_source_on_seek;
pDecoder->ds.onGetDataFormat = ma_decoder__data_source_on_get_data_format;
pDecoder->ds.onGetDataFormat = ma_decoder__data_source_on_get_data_format;
pDecoder->ds.onGetCursor = ma_decoder_
_data_source_on_get_cursor
;
pDecoder->ds.onGetCursor = ma_decoder_
get_cursor_in_pcm_frames
;
pDecoder->ds.onGetLength = ma_decoder__data_source_on_get_length;
pDecoder->ds.onGetLength = ma_decoder__data_source_on_get_length;
pDecoder->onRead = onRead;
pDecoder->onRead = onRead;
...
@@ -45703,6 +45699,23 @@ MA_API ma_result ma_decoder_uninit(ma_decoder* pDecoder)
...
@@ -45703,6 +45699,23 @@ MA_API ma_result ma_decoder_uninit(ma_decoder* pDecoder)
return MA_SUCCESS;
return MA_SUCCESS;
}
}
MA_API ma_result ma_decoder_get_cursor_in_pcm_frames(ma_decoder* pDecoder, ma_uint64* pCursor)
{
if (pCursor == NULL) {
return MA_INVALID_ARGS;
}
*pCursor = 0;
if (pDecoder == NULL) {
return MA_INVALID_ARGS;
}
*pCursor = pDecoder->readPointerInPCMFrames;
return MA_SUCCESS;
}
MA_API ma_uint64 ma_decoder_get_length_in_pcm_frames(ma_decoder* pDecoder)
MA_API ma_uint64 ma_decoder_get_length_in_pcm_frames(ma_decoder* pDecoder)
{
{
if (pDecoder == NULL) {
if (pDecoder == NULL) {
...
@@ -62461,6 +62474,9 @@ The following miscellaneous changes have also been made.
...
@@ -62461,6 +62474,9 @@ The following miscellaneous changes have also been made.
/*
/*
REVISION HISTORY
REVISION HISTORY
================
================
v0.10.17 - TBD
- Add ma_decoder_get_cursor_in_pcm_frames()
v0.10.16 - 2020-08-14
v0.10.16 - 2020-08-14
- WASAPI: Fix a potential crash due to using an uninitialized variable.
- WASAPI: Fix a potential crash due to using an uninitialized variable.
- OpenSL: Enable runtime linking.
- OpenSL: Enable runtime linking.
research/ma_engine.h
View file @
fe85a132
...
@@ -3012,7 +3012,7 @@ static void ma_resource_manager_data_stream_fill_page(ma_resource_manager_data_s
...
@@ -3012,7 +3012,7 @@ static void ma_resource_manager_data_stream_fill_page(ma_resource_manager_data_s
/* Loop back to the start if we reached the end. We'll also have a known length at this point as well. */
/* Loop back to the start if we reached the end. We'll also have a known length at this point as well. */
if
(
framesRead
<
framesRemaining
)
{
if
(
framesRead
<
framesRemaining
)
{
if
(
pDataStream
->
totalLengthInPCMFrames
==
0
)
{
if
(
pDataStream
->
totalLengthInPCMFrames
==
0
)
{
ma_d
ata_source
_get_cursor_in_pcm_frames
(
&
pDataStream
->
decoder
,
&
pDataStream
->
totalLengthInPCMFrames
);
ma_d
ecoder
_get_cursor_in_pcm_frames
(
&
pDataStream
->
decoder
,
&
pDataStream
->
totalLengthInPCMFrames
);
}
}
ma_decoder_seek_to_pcm_frame
(
&
pDataStream
->
decoder
,
0
);
ma_decoder_seek_to_pcm_frame
(
&
pDataStream
->
decoder
,
0
);
...
...
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