Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1c37857a
Commit
1c37857a
authored
May 22, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
May 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss.drv: Track number of frames reserved by client in capture direction.
parent
99661c7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+30
-19
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
1c37857a
...
...
@@ -120,7 +120,6 @@ struct ACImpl {
UINT32
oss_bufsize_bytes
,
lcl_offs_frames
;
/* offs into local_buffer where valid data starts */
BYTE
*
local_buffer
,
*
tmp_buffer
;
int
buf_state
;
LONG32
getbuf_last
;
/* <0 when using tmp_buffer */
HANDLE
timer
;
...
...
@@ -132,12 +131,6 @@ struct ACImpl {
struct
list
entry
;
};
enum
BufferStates
{
NOT_LOCKED
=
0
,
LOCKED_NORMAL
,
/* public buffer piece is from local_buffer */
LOCKED_WRAPPED
/* public buffer piece is in tmp_buffer */
};
typedef
struct
_SessionMgr
{
IAudioSessionManager2
IAudioSessionManager2_iface
;
...
...
@@ -1571,7 +1564,7 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return
AUDCLNT_E_NOT_STOPPED
;
}
if
(
This
->
buf_state
!=
NOT_LOCKED
||
This
->
getbuf_last
){
if
(
This
->
getbuf_last
){
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_BUFFER_OPERATION_PENDING
;
}
...
...
@@ -1928,7 +1921,6 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
UINT64
*
qpcpos
)
{
ACImpl
*
This
=
impl_from_IAudioCaptureClient
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(%p, %p, %p, %p, %p)
\n
"
,
This
,
data
,
frames
,
flags
,
devpos
,
qpcpos
);
...
...
@@ -1938,19 +1930,21 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
EnterCriticalSection
(
&
This
->
lock
);
if
(
This
->
buf_state
!=
NOT_LOCKED
){
if
(
This
->
getbuf_last
){
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_OUT_OF_ORDER
;
}
hr
=
IAudioCaptureClient_GetNextPacketSize
(
iface
,
frames
);
if
(
FAILED
(
hr
)){
if
(
This
->
held_frames
<
This
->
period_frames
){
*
frames
=
0
;
LeaveCriticalSection
(
&
This
->
lock
);
return
hr
;
return
AUDCLNT_S_BUFFER_EMPTY
;
}
*
flags
=
0
;
*
frames
=
This
->
period_frames
;
if
(
This
->
lcl_offs_frames
+
*
frames
>
This
->
bufsize_frames
){
UINT32
chunk_bytes
,
offs_bytes
,
frames_bytes
;
if
(
This
->
tmp_buffer_frames
<
*
frames
){
...
...
@@ -1976,10 +1970,16 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
*
data
=
This
->
local_buffer
+
This
->
lcl_offs_frames
*
This
->
fmt
->
nBlockAlign
;
This
->
buf_state
=
LOCKED_NORMAL
;
This
->
getbuf_last
=
*
frames
;
if
(
devpos
||
qpcpos
)
IAudioClock_GetPosition
(
&
This
->
IAudioClock_iface
,
devpos
,
qpcpos
);
if
(
devpos
)
*
devpos
=
This
->
written_frames
;
if
(
qpcpos
){
LARGE_INTEGER
stamp
,
freq
;
QueryPerformanceCounter
(
&
stamp
);
QueryPerformanceFrequency
(
&
freq
);
*
qpcpos
=
(
stamp
.
QuadPart
*
(
INT64
)
10000000
)
/
freq
.
QuadPart
;
}
LeaveCriticalSection
(
&
This
->
lock
);
...
...
@@ -1995,16 +1995,27 @@ static HRESULT WINAPI AudioCaptureClient_ReleaseBuffer(
EnterCriticalSection
(
&
This
->
lock
);
if
(
This
->
buf_state
==
NOT_LOCKED
){
if
(
!
done
){
This
->
getbuf_last
=
0
;
LeaveCriticalSection
(
&
This
->
lock
);
return
S_OK
;
}
if
(
!
This
->
getbuf_last
){
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_OUT_OF_ORDER
;
}
if
(
This
->
getbuf_last
!=
done
){
LeaveCriticalSection
(
&
This
->
lock
);
return
AUDCLNT_E_INVALID_SIZE
;
}
This
->
written_frames
+=
done
;
This
->
held_frames
-=
done
;
This
->
lcl_offs_frames
+=
done
;
This
->
lcl_offs_frames
%=
This
->
bufsize_frames
;
This
->
buf_state
=
NOT_LOCKED
;
This
->
getbuf_last
=
0
;
LeaveCriticalSection
(
&
This
->
lock
);
...
...
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