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
19eb1b45
Commit
19eb1b45
authored
Oct 24, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: save one mdate() call per (debug) loop
parent
056ee009
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+7
-6
No files found.
modules/audio_output/alsa.c
View file @
19eb1b45
...
...
@@ -820,25 +820,26 @@ static void ALSAFill( aout_instance_t * p_aout )
if
(
delay
==
0
)
/* workaround buggy alsa drivers */
if
(
snd_pcm_delay
(
p_sys
->
p_snd_pcm
,
&
delay
)
<
0
)
delay
=
0
;
/* FIXME: use a positive minimal delay */
int
i_bytes
=
snd_pcm_frames_to_bytes
(
p_sys
->
p_snd_pcm
,
delay
);
next_date
=
mdate
()
+
(
(
mtime_t
)
i_bytes
*
1000000
size_t
i_bytes
=
snd_pcm_frames_to_bytes
(
p_sys
->
p_snd_pcm
,
delay
);
mtime_t
delay_us
=
CLOCK_FREQ
*
i_bytes
/
p_aout
->
output
.
output
.
i_bytes_per_frame
/
p_aout
->
output
.
output
.
i_rate
*
p_aout
->
output
.
output
.
i_frame_length
)
;
*
p_aout
->
output
.
output
.
i_frame_length
;
#ifdef ALSA_DEBUG
snd_pcm_state_t
state
=
snd_pcm_status_get_state
(
p_status
);
if
(
state
!=
SND_PCM_STATE_RUNNING
)
msg_Err
(
p_aout
,
"pcm status (%d) != RUNNING"
,
state
);
msg_Dbg
(
p_aout
,
"Delay is %ld frames (%
d
bytes)"
,
delay
,
i_bytes
);
msg_Dbg
(
p_aout
,
"Delay is %ld frames (%
zu
bytes)"
,
delay
,
i_bytes
);
msg_Dbg
(
p_aout
,
"Bytes per frame: %d"
,
p_aout
->
output
.
output
.
i_bytes_per_frame
);
msg_Dbg
(
p_aout
,
"Rate: %d"
,
p_aout
->
output
.
output
.
i_rate
);
msg_Dbg
(
p_aout
,
"Frame length: %d"
,
p_aout
->
output
.
output
.
i_frame_length
);
msg_Dbg
(
p_aout
,
"Next date is in %d microseconds"
,
(
int
)(
next_date
-
mdate
())
);
msg_Dbg
(
p_aout
,
"Next date: in %"
PRId64
" microseconds"
,
delay_us
);
#endif
next_date
=
mdate
()
+
delay_us
;
}
p_buffer
=
aout_OutputNextBuffer
(
p_aout
,
next_date
,
...
...
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