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
f489cc97
Commit
f489cc97
authored
Jan 29, 2012
by
Jörg Höhle
Committed by
Alexandre Julliard
Jan 31, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Fix the Start/Stop/Reset cycle.
parent
4b888861
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+20
-10
No files found.
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
f489cc97
...
...
@@ -1459,6 +1459,11 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
return
E_OUTOFMEMORY
;
}
if
(
This
->
dataflow
==
eCapture
){
UINT32
frames
;
/* enqueue packets */
AudioCaptureClient_GetNextPacket
(
This
,
&
frames
);
}
This
->
playing
=
StateInTransition
;
sc
=
AudioQueueStart
(
This
->
aqueue
,
NULL
);
...
...
@@ -1523,12 +1528,7 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
}
else
WARN
(
"GetCurrentTime failed: %lx
\n
"
,
sc
);
sc
=
AudioQueueFlush
(
This
->
aqueue
);
if
(
sc
!=
noErr
){
OSSpinLockUnlock
(
&
This
->
lock
);
WARN
(
"Unable to flush audio queue: %lx
\n
"
,
sc
);
}
/* Mac OS bug? Our capture callback is no more called past AQStop */
sc
=
AudioQueuePause
(
This
->
aqueue
);
if
(
sc
!=
noErr
){
OSSpinLockUnlock
(
&
This
->
lock
);
...
...
@@ -1552,6 +1552,7 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
OSStatus
sc
;
QueuedBufInfo
*
bufinfo
,
*
bufinfo2
;
AQBuffer
*
buf
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1572,8 +1573,7 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return
AUDCLNT_E_BUFFER_OPERATION_PENDING
;
}
This
->
written_frames
=
0
;
This
->
inbuf_frames
=
0
;
avail_update
(
This
);
/* going to skip over inbuf_frames */
LIST_FOR_EACH_ENTRY_SAFE
(
bufinfo
,
bufinfo2
,
&
This
->
queued_bufinfos
,
QueuedBufInfo
,
entry
){
...
...
@@ -1588,6 +1588,18 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
return
E_FAIL
;
}
/* AQReset is synchronous */
list_move_tail
(
&
This
->
avail_buffers
,
&
This
->
queued_buffers
);
if
(
This
->
dataflow
==
eRender
){
This
->
written_frames
=
0
;
}
else
{
LIST_FOR_EACH_ENTRY
(
buf
,
&
This
->
avail_buffers
,
AQBuffer
,
entry
)
buf
->
buf
->
mAudioDataByteSize
=
0
;
This
->
written_frames
+=
This
->
inbuf_frames
;
}
This
->
inbuf_frames
=
0
;
OSSpinLockUnlock
(
&
This
->
lock
);
return
S_OK
;
...
...
@@ -1984,8 +1996,6 @@ static HRESULT AudioCaptureClient_GetNextPacket(ACImpl *This, UINT32 *frames)
return
S_OK
;
WARN
(
"empty packet
\n
"
);
/* fixme: for reasons not yet understood, the initially submitted
* packets are returned with 0 bytes. Resubmit them. */
buf
->
used
=
TRUE
;
sc
=
AudioQueueEnqueueBuffer
(
This
->
aqueue
,
This
->
public_buffer
,
0
,
NULL
);
if
(
sc
!=
noErr
){
...
...
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