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
1f96d5f1
Commit
1f96d5f1
authored
Nov 24, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wasapi: fake delay (approximately) if the stream has not started
parent
bb85c711
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
modules/audio_output/wasapi.c
modules/audio_output/wasapi.c
+11
-3
No files found.
modules/audio_output/wasapi.c
View file @
1f96d5f1
...
...
@@ -127,6 +127,7 @@ struct aout_sys_t
uint8_t
bits
;
/**< Bits per sample */
unsigned
rate
;
/**< Sample rate */
unsigned
bytes_per_frame
;
UINT32
written
;
/**< Frames written to the buffer */
UINT32
frames
;
/**< Total buffer size (frames) */
HANDLE
ready
;
/**< Semaphore from MTA thread */
...
...
@@ -155,8 +156,9 @@ static int TimeGet(audio_output_t *aout, mtime_t *restrict delay)
if
(
pos
==
0
)
{
msg_Dbg
(
aout
,
"cannot compute position: still propagating buffers"
);
return
-
1
;
*
delay
=
sys
->
written
*
CLOCK_FREQ
/
sys
->
rate
;
msg_Dbg
(
aout
,
"extrapolating position: still propagating buffers"
);
return
0
;
}
*
delay
=
((
GetQPC
()
-
qpcpos
)
/
(
10000000
/
CLOCK_FREQ
));
...
...
@@ -211,6 +213,7 @@ static void Play(audio_output_t *aout, block_t *block)
block
->
p_buffer
+=
copy
;
block
->
i_buffer
-=
copy
;
block
->
i_nb_samples
-=
frames
;
sys
->
written
+=
frames
;
if
(
block
->
i_nb_samples
==
0
)
break
;
/* done */
...
...
@@ -241,6 +244,7 @@ static void Pause(audio_output_t *aout, bool paused, mtime_t date)
msg_Warn
(
aout
,
"cannot %s stream (error 0x%lx)"
,
paused
?
"stop"
:
"start"
,
hr
);
Leave
();
(
void
)
date
;
}
...
...
@@ -255,9 +259,12 @@ static void Flush(audio_output_t *aout, bool wait)
Enter
();
IAudioClient_Stop
(
sys
->
client
);
hr
=
IAudioClient_Reset
(
sys
->
client
);
Leave
();
if
(
FAILED
(
hr
))
msg_Warn
(
aout
,
"cannot reset stream (error 0x%lx)"
,
hr
);
Leave
();
else
sys
->
written
=
0
;
}
static
int
SimpleVolumeSet
(
audio_output_t
*
aout
,
float
vol
)
...
...
@@ -812,6 +819,7 @@ retry:
sys
->
rate
=
fmt
->
i_rate
;
sys
->
bytes_per_frame
=
fmt
->
i_bytes_per_frame
;
sys
->
written
=
0
;
aout
->
time_get
=
TimeGet
;
aout
->
play
=
Play
;
aout
->
pause
=
Pause
;
...
...
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