Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b0e45368
Commit
b0e45368
authored
Sep 22, 2009
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Oct 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Small capture fixes.
Deadlock, off-by-one and forgetting to declare that we want MMAP access, so accelerated mode wouldn't work at all but fail silently.
parent
6dd6074f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
dscapture.c
dlls/winealsa.drv/dscapture.c
+6
-2
No files found.
dlls/winealsa.drv/dscapture.c
View file @
b0e45368
...
...
@@ -134,7 +134,8 @@ static void CALLBACK Capture_Notify(UINT timerID, UINT msg, DWORD_PTR dwUser, DW
PIDSCDRIVERBUFFER
iface
=
(
PIDSCDRIVERBUFFER
)
This
;
/* **** */
EnterCriticalSection
(
&
This
->
pcm_crst
);
/* Don't deadlock since there is a critical section can be held by the timer api itself while running this code */
if
(
!
TryEnterCriticalSection
(
&
This
->
pcm_crst
))
return
;
IDsDriverBuffer_GetPosition
(
iface
,
&
playpos
,
NULL
);
last_playpos
=
This
->
notify
->
playpos
;
...
...
@@ -555,7 +556,7 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Lock(PIDSCDRIVERBUFFER iface, L
if
(
ppvAudio1
)
*
ppvAudio1
=
(
LPBYTE
)
This
->
presented_buffer
+
dwWritePosition
;
if
(
dwWritePosition
+
dwWriteLen
<
This
->
mmap_buflen_bytes
)
{
if
(
dwWritePosition
+
dwWriteLen
<
=
This
->
mmap_buflen_bytes
)
{
if
(
pdwLen1
)
*
pdwLen1
=
dwWriteLen
;
if
(
ppvAudio2
)
...
...
@@ -631,6 +632,9 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_SetFormat(PIDSCDRIVERBUFFER ifa
/* Set some defaults */
snd_pcm_hw_params_any
(
pcm
,
hw_params
);
err
=
snd_pcm_hw_params_set_access
(
pcm
,
hw_params
,
SND_PCM_ACCESS_MMAP_INTERLEAVED
);
if
(
err
<
0
)
goto
err
;
err
=
snd_pcm_hw_params_set_channels
(
pcm
,
hw_params
,
pwfx
->
nChannels
);
if
(
err
<
0
)
{
WARN
(
"Could not set channels to %d
\n
"
,
pwfx
->
nChannels
);
goto
err
;
}
...
...
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