Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
40d39fa1
Commit
40d39fa1
authored
Nov 05, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recover from ALSA suspend properly if the device does not support resuming
parent
bd0a73c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+13
-5
No files found.
modules/audio_output/alsa.c
View file @
40d39fa1
...
@@ -451,7 +451,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -451,7 +451,7 @@ static int Open( vlc_object_t *p_this )
msg_Dbg
(
p_aout
,
"opening ALSA device `%s'"
,
psz_device
);
msg_Dbg
(
p_aout
,
"opening ALSA device `%s'"
,
psz_device
);
/* Since it seems snd_pcm_close has
e
n't really released the device at
/* Since it seems snd_pcm_close hasn't really released the device at
the time it returns, probe if the device is available in loop for 1s.
the time it returns, probe if the device is available in loop for 1s.
We cannot use blocking mode since the we would wait indefinitely when
We cannot use blocking mode since the we would wait indefinitely when
switching from a dmx device to surround51. */
switching from a dmx device to surround51. */
...
@@ -800,7 +800,7 @@ static void ALSAFill( aout_instance_t * p_aout )
...
@@ -800,7 +800,7 @@ static void ALSAFill( aout_instance_t * p_aout )
return
;
return
;
}
}
/* Handle buffer underruns and
reget the status
*/
/* Handle buffer underruns and
get the status again
*/
if
(
snd_pcm_status_get_state
(
p_status
)
==
SND_PCM_STATE_XRUN
)
if
(
snd_pcm_status_get_state
(
p_status
)
==
SND_PCM_STATE_XRUN
)
{
{
/* Prepare the device */
/* Prepare the device */
...
@@ -810,7 +810,7 @@ static void ALSAFill( aout_instance_t * p_aout )
...
@@ -810,7 +810,7 @@ static void ALSAFill( aout_instance_t * p_aout )
{
{
msg_Dbg
(
p_aout
,
"recovered from buffer underrun"
);
msg_Dbg
(
p_aout
,
"recovered from buffer underrun"
);
/*
Reget the
status */
/*
Get the new
status */
i_snd_rc
=
snd_pcm_status
(
p_sys
->
p_snd_pcm
,
p_status
);
i_snd_rc
=
snd_pcm_status
(
p_sys
->
p_snd_pcm
,
p_status
);
if
(
i_snd_rc
<
0
)
if
(
i_snd_rc
<
0
)
{
{
...
@@ -878,11 +878,19 @@ static void ALSAFill( aout_instance_t * p_aout )
...
@@ -878,11 +878,19 @@ static void ALSAFill( aout_instance_t * p_aout )
{
/* a suspend event occurred
{
/* a suspend event occurred
* (stream is suspended and waiting for an application recovery) */
* (stream is suspended and waiting for an application recovery) */
msg_Dbg
(
p_aout
,
"entering in suspend mode, trying to resume..."
);
msg_Dbg
(
p_aout
,
"entering in suspend mode, trying to resume..."
);
while
(
!
p_aout
->
b_die
&&
!
p_aout
->
p_libvlc
->
b_die
&&
while
(
!
p_aout
->
b_die
&&
!
p_aout
->
p_libvlc
->
b_die
&&
(
i_snd_rc
=
snd_pcm_resume
(
p_sys
->
p_snd_pcm
)
)
==
-
EAGAIN
)
(
i_snd_rc
=
snd_pcm_resume
(
p_sys
->
p_snd_pcm
)
)
==
-
EAGAIN
)
msleep
(
100000
);
msleep
(
100000
);
i_snd_rc
=
snd_pcm_writei
(
p_sys
->
p_snd_pcm
,
p_buffer
->
p_buffer
,
p_buffer
->
i_nb_samples
);
if
(
i_snd_rc
<
0
)
/* Device does not supprot resuming, restart it */
i_snd_rc
=
snd_pcm_prepare
(
p_sys
->
p_snd_pcm
);
if
(
i_snd_rc
<
0
)
i_snd_rc
=
snd_pcm_writei
(
p_sys
->
p_snd_pcm
,
p_buffer
->
p_buffer
,
p_buffer
->
i_nb_samples
);
}
}
...
...
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