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
6ee40754
Commit
6ee40754
authored
Apr 03, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: possible improvement in thread syncronization
parent
d0dfa05a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+5
-3
No files found.
modules/audio_output/auhal.c
View file @
6ee40754
...
...
@@ -1231,8 +1231,10 @@ static void Flush(audio_output_t *p_aout, bool wait)
if
(
wait
)
{
int32_t
availableBytes
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
while
(
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
)
!=
NULL
)
{
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
);
while
(
availableBytes
>
0
)
{
vlc_cond_wait
(
&
p_sys
->
cond
,
&
p_sys
->
lock
);
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
);
}
vlc_mutex_unlock
(
&
p_sys
->
lock
);
...
...
@@ -1283,6 +1285,7 @@ static OSStatus RenderCallbackAnalog(vlc_object_t *p_obj,
int
bytesToCopy
=
ioData
->
mBuffers
[
0
].
mDataByteSize
;
Float32
*
targetBuffer
=
(
Float32
*
)
ioData
->
mBuffers
[
0
].
mData
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
/* Pull audio from buffer */
int32_t
availableBytes
;
Float32
*
buffer
=
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
);
...
...
@@ -1297,7 +1300,6 @@ static OSStatus RenderCallbackAnalog(vlc_object_t *p_obj,
TPCircularBufferConsume
(
&
p_sys
->
circular_buffer
,
__MIN
(
bytesToCopy
,
availableBytes
));
}
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_cond_signal
(
&
p_sys
->
cond
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
...
...
@@ -1327,6 +1329,7 @@ static OSStatus RenderCallbackSPDIF (AudioDeviceID inDevice,
int
bytesToCopy
=
outOutputData
->
mBuffers
[
p_sys
->
i_stream_index
].
mDataByteSize
;
char
*
targetBuffer
=
outOutputData
->
mBuffers
[
p_sys
->
i_stream_index
].
mData
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
/* Pull audio from buffer */
int32_t
availableBytes
;
char
*
buffer
=
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
);
...
...
@@ -1340,7 +1343,6 @@ static OSStatus RenderCallbackSPDIF (AudioDeviceID inDevice,
TPCircularBufferConsume
(
&
p_sys
->
circular_buffer
,
__MIN
(
bytesToCopy
,
availableBytes
));
}
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_cond_signal
(
&
p_sys
->
cond
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
...
...
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