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
32978845
Commit
32978845
authored
Mar 24, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: implement drain
parent
4535d109
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+26
-6
No files found.
modules/audio_output/auhal.c
View file @
32978845
...
...
@@ -110,6 +110,7 @@ struct aout_sys_t
struct
audio_device_t
*
devices
;
vlc_mutex_t
lock
;
vlc_cond_t
cond
;
};
struct
audio_device_t
...
...
@@ -181,6 +182,7 @@ static int Open(vlc_object_t *obj)
return
VLC_ENOMEM
;
vlc_mutex_init
(
&
sys
->
lock
);
vlc_cond_init
(
&
sys
->
cond
);
aout
->
sys
=
sys
;
aout
->
start
=
Start
;
...
...
@@ -216,6 +218,7 @@ static void Close(vlc_object_t *obj)
}
vlc_mutex_destroy
(
&
sys
->
lock
);
vlc_cond_destroy
(
&
sys
->
cond
);
free
(
sys
);
}
...
...
@@ -1225,14 +1228,23 @@ 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
;
VLC_UNUSED
(
wait
);
struct
aout_sys_t
*
p_sys
=
p_aout
->
sys
;
if
(
wait
)
{
int32_t
availableBytes
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
while
(
TPCircularBufferTail
(
&
p_sys
->
circular_buffer
,
&
availableBytes
)
!=
NULL
)
{
vlc_cond_wait
(
&
p_sys
->
cond
,
&
p_sys
->
lock
);
}
vlc_mutex_unlock
(
&
p_sys
->
lock
);
}
else
{
p_sys
->
b_got_first_sample
=
false
;
/* flush circular buffer */
AudioOutputUnitStop
(
p_aout
->
sys
->
au_unit
);
TPCircularBufferClear
(
&
p_aout
->
sys
->
circular_buffer
);
}
}
static
int
TimeGet
(
audio_output_t
*
p_aout
,
mtime_t
*
delay
)
...
...
@@ -1287,6 +1299,10 @@ static OSStatus RenderCallbackAnalog(vlc_object_t *p_obj,
VLC_UNUSED
(
inNumberFrames
);
}
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_cond_signal
(
&
p_sys
->
cond
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
noErr
;
}
...
...
@@ -1326,6 +1342,10 @@ 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
);
return
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