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
af3fa1c4
Commit
af3fa1c4
authored
Mar 12, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Mar 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable exact position calculation when hardware supports it.
parent
cb86255d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
6 deletions
+35
-6
audio.c
dlls/winmm/wineoss/audio.c
+35
-6
No files found.
dlls/winmm/wineoss/audio.c
View file @
af3fa1c4
...
...
@@ -34,7 +34,8 @@
/* an exact wodGetPosition is usually not worth the extra context switches,
* as we're going to have near fragment accuracy anyway */
/* #define EXACT_WODPOSITION */
#define EXACT_WODPOSITION
#define EXACT_WIDPOSITION
#include "config.h"
#include "wine/port.h"
...
...
@@ -211,6 +212,7 @@ typedef struct {
PCMWAVEFORMAT
format
;
LPWAVEHDR
lpQueuePtr
;
DWORD
dwTotalRecorded
;
DWORD
dwTotalRead
;
/* synchronization stuff */
HANDLE
hThread
;
...
...
@@ -1873,11 +1875,15 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize)
return
MMSYSERR_BADDEVICEID
;
}
if
(
lpTime
==
NULL
)
return
MMSYSERR_INVALPARAM
;
if
(
lpTime
==
NULL
)
{
WARN
(
"invalid parameter: lpTime == NULL
\n
"
);
return
MMSYSERR_INVALPARAM
;
}
wwo
=
&
WOutDev
[
wDevID
];
#ifdef EXACT_WODPOSITION
OSS_AddRingMessage
(
&
wwo
->
msgRing
,
WINE_WM_UPDATE
,
0
,
TRUE
);
if
(
wwo
->
ossdev
->
out_caps
.
dwSupport
&
WAVECAPS_SAMPLEACCURATE
)
OSS_AddRingMessage
(
&
wwo
->
msgRing
,
WINE_WM_UPDATE
,
0
,
TRUE
);
#endif
val
=
wwo
->
dwPlayedTotal
;
...
...
@@ -3068,6 +3074,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
wwi
->
state
=
WINE_WS_STOPPED
;
wwi
->
dwTotalRecorded
=
0
;
wwi
->
dwTotalRead
=
0
;
wwi
->
lpQueuePtr
=
NULL
;
SetEvent
(
wwi
->
hStartUpEvent
);
...
...
@@ -3117,7 +3124,8 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
{
/* update number of bytes recorded in current buffer and by this device */
lpWaveHdr
->
dwBytesRecorded
+=
bytesRead
;
wwi
->
dwTotalRecorded
+=
bytesRead
;
wwi
->
dwTotalRead
+=
bytesRead
;
wwi
->
dwTotalRecorded
=
wwi
->
dwTotalRead
;
/* buffer is full. notify client */
if
(
lpWaveHdr
->
dwBytesRecorded
==
lpWaveHdr
->
dwBufferLength
)
...
...
@@ -3155,7 +3163,8 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
/* update number of bytes recorded in current buffer and by this device */
lpWaveHdr
->
dwBytesRecorded
+=
dwToCopy
;
wwi
->
dwTotalRecorded
+=
dwToCopy
;
wwi
->
dwTotalRead
+=
dwToCopy
;
wwi
->
dwTotalRecorded
=
wwi
->
dwTotalRead
;
bytesRead
-=
dwToCopy
;
pOffset
+=
dwToCopy
;
...
...
@@ -3305,6 +3314,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
}
wwi
->
state
=
WINE_WS_STOPPED
;
wwi
->
dwTotalRecorded
=
0
;
wwi
->
dwTotalRead
=
0
;
/* read any headers in queue */
widRecorder_ReadHeaders
(
wwi
);
...
...
@@ -3321,6 +3331,16 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
wwi
->
lpQueuePtr
=
NULL
;
SetEvent
(
ev
);
break
;
case
WINE_WM_UPDATE
:
if
(
wwi
->
state
==
WINE_WS_PLAYING
)
{
audio_buf_info
tmp_info
;
if
(
ioctl
(
wwi
->
ossdev
->
fd
,
SNDCTL_DSP_GETISPACE
,
&
tmp_info
)
<
0
)
ERR
(
"ioctl(%s, SNDCTL_DSP_GETISPACE) failed (%s)
\n
"
,
wwi
->
ossdev
->
dev_name
,
strerror
(
errno
));
else
wwi
->
dwTotalRecorded
=
wwi
->
dwTotalRead
+
tmp_info
.
bytes
;
}
SetEvent
(
ev
);
break
;
case
WINE_WM_CLOSING
:
wwi
->
hThread
=
0
;
wwi
->
state
=
WINE_WS_CLOSED
;
...
...
@@ -3431,6 +3451,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwi
->
lpQueuePtr
=
NULL
;
}
wwi
->
dwTotalRecorded
=
0
;
wwi
->
dwTotalRead
=
0
;
wwi
->
wFlags
=
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
);
memcpy
(
&
wwi
->
waveDesc
,
lpDesc
,
sizeof
(
WAVEOPENDESC
));
...
...
@@ -3623,9 +3644,17 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize)
WARN
(
"can't get pos !
\n
"
);
return
MMSYSERR_INVALHANDLE
;
}
if
(
lpTime
==
NULL
)
return
MMSYSERR_INVALPARAM
;
if
(
lpTime
==
NULL
)
{
WARN
(
"invalid parameter: lpTime == NULL
\n
"
);
return
MMSYSERR_INVALPARAM
;
}
wwi
=
&
WInDev
[
wDevID
];
#ifdef EXACT_WIDPOSITION
if
(
wwi
->
ossdev
->
in_caps_support
&
WAVECAPS_SAMPLEACCURATE
)
OSS_AddRingMessage
(
&
(
wwi
->
msgRing
),
WINE_WM_UPDATE
,
0
,
TRUE
);
#endif
TRACE
(
"wType=%04X !
\n
"
,
lpTime
->
wType
);
TRACE
(
"wBitsPerSample=%u
\n
"
,
wwi
->
format
.
wBitsPerSample
);
...
...
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