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
832f36a0
Commit
832f36a0
authored
May 18, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: Fix a bug where the device cannot be restarted.
parent
1a851bb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
miniaudio.h
miniaudio.h
+20
-5
No files found.
miniaudio.h
View file @
832f36a0
...
...
@@ -3783,13 +3783,13 @@ int ma_strncat_s(char* dst, size_t dstSizeInBytes, const char* src, size_t count
char* dstorig;
if (dst == 0) {
return
EINVAL
;
return
22
;
}
if (dstSizeInBytes == 0) {
return
ERANGE
;
return
34
;
}
if (src == 0) {
return
EINVAL
;
return
22
;
}
dstorig = dst;
...
...
@@ -3800,7 +3800,7 @@ int ma_strncat_s(char* dst, size_t dstSizeInBytes, const char* src, size_t count
}
if (dstSizeInBytes == 0) {
return
EINVAL
; /* Unterminated. */
return
22
; /* Unterminated. */
}
...
...
@@ -3818,7 +3818,7 @@ int ma_strncat_s(char* dst, size_t dstSizeInBytes, const char* src, size_t count
dst[0] = '\0';
} else {
dstorig[0] = '\0';
return
ERANGE
;
return
34
;
}
return 0;
...
...
@@ -13322,14 +13322,29 @@ ma_result ma_device_stop__alsa(ma_device* pDevice)
if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) {
((ma_snd_pcm_drain_proc)pDevice->pContext->alsa.snd_pcm_drain)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture);
/* We need to prepare the device again, otherwise we won't be able to restart the device. */
if (((ma_snd_pcm_prepare_proc)pDevice->pContext->alsa.snd_pcm_prepare)((ma_snd_pcm_t*)pDevice->alsa.pPCMCapture) < 0) {
#ifdef MA_DEBUG_OUTPUT
printf("[ALSA] Failed to prepare capture device after stopping.\n");
#endif
}
}
if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) {
/* Using drain instead of drop because ma_device_stop() is defined such that pending frames are processed before returning. */
((ma_snd_pcm_drain_proc)pDevice->pContext->alsa.snd_pcm_drain)((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback);
/* We need to prepare the device again, otherwise we won't be able to restart the device. */
if (((ma_snd_pcm_prepare_proc)pDevice->pContext->alsa.snd_pcm_prepare)((ma_snd_pcm_t*)pDevice->alsa.pPCMPlayback) < 0) {
#ifdef MA_DEBUG_OUTPUT
printf("[ALSA] Failed to prepare playback device after stopping.\n");
#endif
}
}
return MA_SUCCESS;
}
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