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
7f61ec3c
Commit
7f61ec3c
authored
Jul 30, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio(4): Some cross platform fixes.
parent
d18e8095
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
21 deletions
+1
-21
mini_al.h
mini_al.h
+1
-21
No files found.
mini_al.h
View file @
7f61ec3c
...
@@ -16970,7 +16970,7 @@ mal_result mal_device__stop_backend__audio4(mal_device* pDevice)
...
@@ -16970,7 +16970,7 @@ mal_result mal_device__stop_backend__audio4(mal_device* pDevice)
return MAL_INVALID_ARGS;
return MAL_INVALID_ARGS;
}
}
#if
defined(__NetBSD__
)
#if
!defined(MAL_AUDIO4_USE_NEW_API
)
if (ioctl(pDevice->audio4.fd, AUDIO_FLUSH, 0) < 0) {
if (ioctl(pDevice->audio4.fd, AUDIO_FLUSH, 0) < 0) {
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[audio4] Failed to stop device. AUDIO_FLUSH failed.", MAL_FAILED_TO_STOP_BACKEND_DEVICE);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[audio4] Failed to stop device. AUDIO_FLUSH failed.", MAL_FAILED_TO_STOP_BACKEND_DEVICE);
}
}
...
@@ -17051,7 +17051,6 @@ mal_result mal_device__main_loop__audio4(mal_device* pDevice)
...
@@ -17051,7 +17051,6 @@ mal_result mal_device__main_loop__audio4(mal_device* pDevice)
return result;
return result;
}
}
size_t bytesToWrite = pDevice->audio4.fragmentSizeInFrames * mal_get_bytes_per_frame(pDevice->internalFormat, pDevice->internalChannels);
size_t bytesToWrite = pDevice->audio4.fragmentSizeInFrames * mal_get_bytes_per_frame(pDevice->internalFormat, pDevice->internalChannels);
while (bytesToWrite > 0) {
while (bytesToWrite > 0) {
ssize_t bytesWritten = write(pDevice->audio4.fd, pDevice->audio4.pIntermediaryBuffer, bytesToWrite);
ssize_t bytesWritten = write(pDevice->audio4.fd, pDevice->audio4.pIntermediaryBuffer, bytesToWrite);
...
@@ -17076,25 +17075,7 @@ mal_result mal_device__main_loop__audio4(mal_device* pDevice)
...
@@ -17076,25 +17075,7 @@ mal_result mal_device__main_loop__audio4(mal_device* pDevice)
size_t bytesToRead = pDevice->audio4.fragmentSizeInFrames * mal_get_bytes_per_frame(pDevice->internalFormat, pDevice->internalChannels);
size_t bytesToRead = pDevice->audio4.fragmentSizeInFrames * mal_get_bytes_per_frame(pDevice->internalFormat, pDevice->internalChannels);
while (bytesToRead > 0) {
while (bytesToRead > 0) {
ssize_t bytesRead = read(pDevice->audio4.fd, pDevice->audio4.pIntermediaryBuffer, bytesToRead);
ssize_t bytesRead = read(pDevice->audio4.fd, pDevice->audio4.pIntermediaryBuffer, bytesToRead);
if (bytesRead < 0) {
if (bytesRead < 0) {
#if MAL_DEBUG_OUTPUT
printf("read() failed: errno=%d\n", errno);
audio_info_t info;
if (ioctl(pDevice->audio4.fd, AUDIO_GETINFO, &info) < 0) {
printf("ioctl failed.\n");
}
printf("MODE: %d\n", info.mode);
printf("PAUSED: %d\n", info.record.pause);
printf("EOF: %d\n", info.record.eof);
printf("SAMPELS: %d\n", info.record.samples);
printf("ERROR: %d\n", info.record.error);
printf("WAITING: %d\n", info.record.waiting);
printf("OPEN: %d\n", info.record.open);
printf("ACTIVE: %d\n", info.record.active);
#endif
if (errno == EAGAIN) {
if (errno == EAGAIN) {
break;
break;
}
}
...
@@ -17106,7 +17087,6 @@ mal_result mal_device__main_loop__audio4(mal_device* pDevice)
...
@@ -17106,7 +17087,6 @@ mal_result mal_device__main_loop__audio4(mal_device* pDevice)
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[audio4] Failed to read any data from the device.", MAL_FAILED_TO_READ_DATA_FROM_DEVICE);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[audio4] Failed to read any data from the device.", MAL_FAILED_TO_READ_DATA_FROM_DEVICE);
}
}
bytesToRead -= bytesRead;
bytesToRead -= bytesRead;
totalBytesRead += bytesRead;
totalBytesRead += bytesRead;
}
}
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