Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
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
videolan
vlc-2-2
Commits
3aa6b1be
Commit
3aa6b1be
authored
Feb 23, 2014
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: check if render callback does not want data
Indeed this can happen rarely.
parent
de2d8633
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+4
-2
No files found.
modules/audio_output/auhal.c
View file @
3aa6b1be
...
...
@@ -1302,6 +1302,8 @@ static OSStatus RenderCallbackAnalog(vlc_object_t *p_obj,
int
bytesRequested
=
ioData
->
mBuffers
[
0
].
mDataByteSize
;
Float32
*
targetBuffer
=
(
Float32
*
)
ioData
->
mBuffers
[
0
].
mData
;
if
(
unlikely
(
bytesRequested
==
0
))
/* cannot be negative */
return
noErr
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
/* Pull audio from buffer */
...
...
@@ -1314,7 +1316,6 @@ static OSStatus RenderCallbackAnalog(vlc_object_t *p_obj,
memset
(
targetBuffer
,
0
,
bytesRequested
);
}
else
{
int32_t
bytesToCopy
=
__MIN
(
bytesRequested
,
availableBytes
);
assert
(
bytesToCopy
>
0
);
memcpy
(
targetBuffer
,
buffer
,
bytesToCopy
);
TPCircularBufferConsume
(
&
p_sys
->
circular_buffer
,
bytesToCopy
);
...
...
@@ -1349,6 +1350,8 @@ static OSStatus RenderCallbackSPDIF(AudioDeviceID inDevice,
int
bytesRequested
=
outOutputData
->
mBuffers
[
p_sys
->
i_stream_index
].
mDataByteSize
;
char
*
targetBuffer
=
outOutputData
->
mBuffers
[
p_sys
->
i_stream_index
].
mData
;
if
(
unlikely
(
bytesRequested
==
0
))
/* cannot be negative */
return
noErr
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
/* Pull audio from buffer */
...
...
@@ -1361,7 +1364,6 @@ static OSStatus RenderCallbackSPDIF(AudioDeviceID inDevice,
memset
(
targetBuffer
,
0
,
bytesRequested
);
}
else
{
int32_t
bytesToCopy
=
__MIN
(
bytesRequested
,
availableBytes
);
assert
(
bytesToCopy
>
0
);
memcpy
(
targetBuffer
,
buffer
,
bytesToCopy
);
TPCircularBufferConsume
(
&
p_sys
->
circular_buffer
,
bytesToCopy
);
...
...
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