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
8977670d
Commit
8977670d
authored
May 04, 2002
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More stable audio output [Mac OS X port] with more output buffering.
parent
d6aabb96
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
plugins/macosx/aout_macosx.c
plugins/macosx/aout_macosx.c
+17
-16
No files found.
plugins/macosx/aout_macosx.c
View file @
8977670d
...
...
@@ -2,7 +2,7 @@
* aout_macosx.c : CoreAudio output plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout_macosx.c,v 1.
19 2002/05/01 22:32:27
massiot Exp $
* $Id: aout_macosx.c,v 1.
20 2002/05/04 13:48:31
massiot Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
...
...
@@ -334,18 +334,12 @@ static OSStatus CAIOCallback( AudioDeviceID inDevice,
intf_Msg( "%lld", AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000 + p_aout->p_sys->clock_diff - p_aout->date );
#endif
/* see aout_Play below */
vlc_mutex_lock
(
&
p_sys
->
mutex_lock
);
vlc_cond_signal
(
&
p_sys
->
cond_sync
);
/* move data into output data buffer */
if
(
p_sys
->
b_buffer_data
)
{
BlockMoveData
(
p_sys
->
p_buffer
,
outOutputData
->
mBuffers
[
0
].
mData
,
p_sys
->
ui_buffer_size
);
p_sys
->
b_buffer_data
=
0
;
}
else
{
...
...
@@ -353,6 +347,10 @@ static OSStatus CAIOCallback( AudioDeviceID inDevice,
intf_WarnMsg
(
1
,
"aout warning: audio output is starving, expect glitches"
);
}
/* see aout_Play below */
vlc_mutex_lock
(
&
p_sys
->
mutex_lock
);
p_sys
->
b_buffer_data
=
0
;
vlc_cond_signal
(
&
p_sys
->
cond_sync
);
vlc_mutex_unlock
(
&
p_sys
->
mutex_lock
);
return
(
noErr
);
...
...
@@ -366,6 +364,17 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
OSStatus
err
;
UInt32
ui_buffer_size
=
p_aout
->
p_sys
->
ui_buffer_size
;
/*
* wait for a callback to occur (to flush the buffer), so aout_Play
* can't be called twice, losing the data we just wrote.
*/
vlc_mutex_lock
(
&
p_aout
->
p_sys
->
mutex_lock
);
if
(
p_aout
->
p_sys
->
b_buffer_data
)
{
vlc_cond_wait
(
&
p_aout
->
p_sys
->
cond_sync
,
&
p_aout
->
p_sys
->
mutex_lock
);
}
vlc_mutex_unlock
(
&
p_aout
->
p_sys
->
mutex_lock
);
err
=
AudioConverterConvertBuffer
(
p_aout
->
p_sys
->
s_converter
,
i_size
,
buffer
,
&
ui_buffer_size
,
...
...
@@ -379,14 +388,6 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
p_aout
->
p_sys
->
b_buffer_data
=
1
;
}
/*
* wait for a callback to occur (to flush the buffer), so aout_Play
* can't be called twice, losing the data we just wrote.
*/
vlc_mutex_lock
(
&
p_aout
->
p_sys
->
mutex_lock
);
vlc_cond_wait
(
&
p_aout
->
p_sys
->
cond_sync
,
&
p_aout
->
p_sys
->
mutex_lock
);
vlc_mutex_unlock
(
&
p_aout
->
p_sys
->
mutex_lock
);
}
/*****************************************************************************
...
...
@@ -429,7 +430,7 @@ static int CABeginFormat( aout_thread_t *p_aout )
kAudioDevicePropertyBufferSize
,
ui_param_size
,
&
p_aout
->
p_sys
->
ui_buffer_size
);
p_aout
->
i_latency
=
p_aout
->
p_sys
->
ui_buffer_size
;
p_aout
->
i_latency
=
p_aout
->
p_sys
->
ui_buffer_size
/
2
;
if
(
err
!=
noErr
)
{
...
...
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