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
8669f200
Commit
8669f200
authored
Dec 02, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dr_mp3.
parent
c4a07602
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
9 deletions
+48
-9
extras/dr_mp3.h
extras/dr_mp3.h
+28
-5
miniaudio.h
miniaudio.h
+20
-4
No files found.
extras/dr_mp3.h
View file @
8669f200
/*
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_mp3 - v0.6.2
1 - 2020-11-28
dr_mp3 - v0.6.2
2 - 2020-12-02
David Reid - mackron@gmail.com
...
...
@@ -95,7 +95,7 @@ extern "C" {
#define DRMP3_VERSION_MAJOR 0
#define DRMP3_VERSION_MINOR 6
#define DRMP3_VERSION_REVISION 2
1
#define DRMP3_VERSION_REVISION 2
2
#define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
#include <stddef.h>
/* For size_t. */
...
...
@@ -3487,22 +3487,38 @@ static drmp3_bool32 drmp3__on_seek_stdio(void* pUserData, int offset, drmp3_seek
DRMP3_API
drmp3_bool32
drmp3_init_file
(
drmp3
*
pMP3
,
const
char
*
pFilePath
,
const
drmp3_allocation_callbacks
*
pAllocationCallbacks
)
{
drmp3_bool32
result
;
FILE
*
pFile
;
if
(
drmp3_fopen
(
&
pFile
,
pFilePath
,
"rb"
)
!=
DRMP3_SUCCESS
)
{
return
DRMP3_FALSE
;
}
return
drmp3_init
(
pMP3
,
drmp3__on_read_stdio
,
drmp3__on_seek_stdio
,
(
void
*
)
pFile
,
pAllocationCallbacks
);
result
=
drmp3_init
(
pMP3
,
drmp3__on_read_stdio
,
drmp3__on_seek_stdio
,
(
void
*
)
pFile
,
pAllocationCallbacks
);
if
(
result
!=
DRMP3_TRUE
)
{
fclose
(
pFile
);
return
result
;
}
return
DRMP3_TRUE
;
}
DRMP3_API
drmp3_bool32
drmp3_init_file_w
(
drmp3
*
pMP3
,
const
wchar_t
*
pFilePath
,
const
drmp3_allocation_callbacks
*
pAllocationCallbacks
)
{
drmp3_bool32
result
;
FILE
*
pFile
;
if
(
drmp3_wfopen
(
&
pFile
,
pFilePath
,
L"rb"
,
pAllocationCallbacks
)
!=
DRMP3_SUCCESS
)
{
return
DRMP3_FALSE
;
}
return
drmp3_init
(
pMP3
,
drmp3__on_read_stdio
,
drmp3__on_seek_stdio
,
(
void
*
)
pFile
,
pAllocationCallbacks
);
result
=
drmp3_init
(
pMP3
,
drmp3__on_read_stdio
,
drmp3__on_seek_stdio
,
(
void
*
)
pFile
,
pAllocationCallbacks
);
if
(
result
!=
DRMP3_TRUE
)
{
fclose
(
pFile
);
return
result
;
}
return
DRMP3_TRUE
;
}
#endif
...
...
@@ -3514,7 +3530,11 @@ DRMP3_API void drmp3_uninit(drmp3* pMP3)
#ifndef DR_MP3_NO_STDIO
if
(
pMP3
->
onRead
==
drmp3__on_read_stdio
)
{
fclose
((
FILE
*
)
pMP3
->
pUserData
);
FILE
*
pFile
=
(
FILE
*
)
pMP3
->
pUserData
;
if
(
pFile
!=
NULL
)
{
fclose
(
pFile
);
pMP3
->
pUserData
=
NULL
;
/* Make sure the file handle is cleared to NULL to we don't attempt to close it a second time. */
}
}
#endif
...
...
@@ -4438,6 +4458,9 @@ counts rather than sample counts.
/*
REVISION HISTORY
================
v0.6.22 - 2020-12-02
- Fix an error where it's possible for a file handle to be left open when initialization of the decoder fails.
v0.6.21 - 2020-11-28
- Bring up to date with minimp3.
...
...
miniaudio.h
View file @
8669f200
...
...
@@ -45200,7 +45200,7 @@ extern "C" {
#define DRMP3_XSTRINGIFY(x) DRMP3_STRINGIFY(x)
#define DRMP3_VERSION_MAJOR 0
#define DRMP3_VERSION_MINOR 6
#define DRMP3_VERSION_REVISION 2
1
#define DRMP3_VERSION_REVISION 2
2
#define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
#include <stddef.h>
typedef signed char drmp3_int8;
...
...
@@ -63599,19 +63599,31 @@ static drmp3_bool32 drmp3__on_seek_stdio(void* pUserData, int offset, drmp3_seek
}
DRMP3_API drmp3_bool32 drmp3_init_file(drmp3* pMP3, const char* pFilePath, const drmp3_allocation_callbacks* pAllocationCallbacks)
{
drmp3_bool32 result;
FILE* pFile;
if (drmp3_fopen(&pFile, pFilePath, "rb") != DRMP3_SUCCESS) {
return DRMP3_FALSE;
}
return drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks);
result = drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks);
if (result != DRMP3_TRUE) {
fclose(pFile);
return result;
}
return DRMP3_TRUE;
}
DRMP3_API drmp3_bool32 drmp3_init_file_w(drmp3* pMP3, const wchar_t* pFilePath, const drmp3_allocation_callbacks* pAllocationCallbacks)
{
drmp3_bool32 result;
FILE* pFile;
if (drmp3_wfopen(&pFile, pFilePath, L"rb", pAllocationCallbacks) != DRMP3_SUCCESS) {
return DRMP3_FALSE;
}
return drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks);
result = drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks);
if (result != DRMP3_TRUE) {
fclose(pFile);
return result;
}
return DRMP3_TRUE;
}
#endif
DRMP3_API void drmp3_uninit(drmp3* pMP3)
...
...
@@ -63621,7 +63633,11 @@ DRMP3_API void drmp3_uninit(drmp3* pMP3)
}
#ifndef DR_MP3_NO_STDIO
if (pMP3->onRead == drmp3__on_read_stdio) {
fclose((FILE*)pMP3->pUserData);
FILE* pFile = (FILE*)pMP3->pUserData;
if (pFile != NULL) {
fclose(pFile);
pMP3->pUserData = NULL;
}
}
#endif
drmp3__free_from_callbacks(pMP3->pData, &pMP3->allocationCallbacks);
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