Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
50229412
Commit
50229412
authored
Dec 27, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audiounit_ios: merge stability improvements from AUHAL module
parent
1c3973d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
modules/audio_output/audiounit_ios.c
modules/audio_output/audiounit_ios.c
+17
-11
No files found.
modules/audio_output/audiounit_ios.c
View file @
50229412
...
...
@@ -336,20 +336,24 @@ static void Pause (audio_output_t *p_aout, bool pause, mtime_t date)
static
void
Flush
(
audio_output_t
*
p_aout
,
bool
wait
)
{
struct
aout_sys_t
*
p_sys
=
p_aout
->
sys
;
struct
aout_sys_t
*
p_sys
=
p_aout
->
sys
;
int32_t
availableBytes
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
);
if
(
wait
)
{
int32_t
availableBytes
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
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
);
}
else
/* flush circular buffer */
TPCircularBufferClear
(
&
p_aout
->
sys
->
circular_buffer
);
}
else
{
/* flush circular buffer if data is left */
if
(
availableBytes
>
0
)
TPCircularBufferClear
(
&
p_aout
->
sys
->
circular_buffer
);
}
vlc_mutex_unlock
(
&
p_sys
->
lock
);
}
static
int
TimeGet
(
audio_output_t
*
p_aout
,
mtime_t
*
delay
)
...
...
@@ -402,9 +406,11 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
}
else
{
int32_t
bytesToCopy
=
__MIN
(
bytesRequested
,
availableBytes
);
memcpy
(
targetBuffer
,
buffer
,
bytesToCopy
);
TPCircularBufferConsume
(
&
p_sys
->
circular_buffer
,
bytesToCopy
);
ioData
->
mBuffers
[
0
].
mDataByteSize
=
bytesToCopy
;
if
(
likely
(
bytesToCopy
>
0
))
{
memcpy
(
targetBuffer
,
buffer
,
bytesToCopy
);
TPCircularBufferConsume
(
&
p_sys
->
circular_buffer
,
bytesToCopy
);
ioData
->
mBuffers
[
0
].
mDataByteSize
=
bytesToCopy
;
}
}
vlc_cond_signal
(
&
p_sys
->
cond
);
...
...
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