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
c75c2668
Commit
c75c2668
authored
Jun 01, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Jun 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug where wrong a return value was returned when mapping is
not possible.
parent
cd072ca2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
wavemap.c
dlls/winmm/wavemap/wavemap.c
+16
-2
No files found.
dlls/winmm/wavemap/wavemap.c
View file @
c75c2668
...
@@ -121,6 +121,7 @@ static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
...
@@ -121,6 +121,7 @@ static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
DWORD
dwFlags
)
DWORD
dwFlags
)
{
{
DWORD
ret
;
DWORD
ret
;
TRACE
(
"(%p, %04x, %p, %p, %08lx)
\n
"
,
wom
,
idx
,
lpDesc
,
lpwfx
,
dwFlags
);
/* destination is always PCM, so the formulas below apply */
/* destination is always PCM, so the formulas below apply */
lpwfx
->
nBlockAlign
=
(
lpwfx
->
nChannels
*
lpwfx
->
wBitsPerSample
)
/
8
;
lpwfx
->
nBlockAlign
=
(
lpwfx
->
nChannels
*
lpwfx
->
wBitsPerSample
)
/
8
;
...
@@ -138,6 +139,7 @@ static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
...
@@ -138,6 +139,7 @@ static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx,
wom
->
hAcmStream
=
0
;
wom
->
hAcmStream
=
0
;
}
}
}
}
WARN
(
"ret = %08lx
\n
"
,
ret
);
return
ret
;
return
ret
;
}
}
...
@@ -146,6 +148,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -146,6 +148,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
UINT
ndlo
,
ndhi
;
UINT
ndlo
,
ndhi
;
UINT
i
;
UINT
i
;
WAVEMAPDATA
*
wom
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
WAVEMAPDATA
*
wom
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
DWORD
res
;
TRACE
(
"(%p %p %08lx)
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
TRACE
(
"(%p %p %08lx)
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
...
@@ -187,7 +190,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -187,7 +190,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* try some ACM stuff */
/* try some ACM stuff */
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
switch (wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
switch (
res=
wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
case MMSYSERR_NOERROR: wom->avgSpeedInner = wfx.nAvgBytesPerSec; goto found; \
case MMSYSERR_NOERROR: wom->avgSpeedInner = wfx.nAvgBytesPerSec; goto found; \
case WAVERR_BADFORMAT: break; \
case WAVERR_BADFORMAT: break; \
default: goto error; \
default: goto error; \
...
@@ -255,6 +258,11 @@ found:
...
@@ -255,6 +258,11 @@ found:
return
MMSYSERR_NOERROR
;
return
MMSYSERR_NOERROR
;
error:
error:
HeapFree
(
GetProcessHeap
(),
0
,
wom
);
HeapFree
(
GetProcessHeap
(),
0
,
wom
);
if
(
res
==
ACMERR_NOTPOSSIBLE
)
{
WARN
(
"ret = WAVERR_BADFORMAT
\n
"
);
return
WAVERR_BADFORMAT
;
}
WARN
(
"ret = MMSYSERR_ERROR
\n
"
);
return
MMSYSERR_ERROR
;
return
MMSYSERR_ERROR
;
}
}
...
@@ -594,6 +602,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -594,6 +602,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
UINT
ndlo
,
ndhi
;
UINT
ndlo
,
ndhi
;
UINT
i
;
UINT
i
;
WAVEMAPDATA
*
wim
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
WAVEMAPDATA
*
wim
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEMAPDATA
));
DWORD
res
;
TRACE
(
"(%p %p %08lx)
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
TRACE
(
"(%p %p %08lx)
\n
"
,
lpdwUser
,
lpDesc
,
dwFlags
);
...
@@ -635,7 +644,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -635,7 +644,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* try some ACM stuff */
/* try some ACM stuff */
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
switch (widOpenHelper(wim, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
switch (
res=
widOpenHelper(wim, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
case MMSYSERR_NOERROR: wim->avgSpeedInner = wfx.nAvgBytesPerSec; goto found; \
case MMSYSERR_NOERROR: wim->avgSpeedInner = wfx.nAvgBytesPerSec; goto found; \
case WAVERR_BADFORMAT: break; \
case WAVERR_BADFORMAT: break; \
default: goto error; \
default: goto error; \
...
@@ -702,6 +711,11 @@ found:
...
@@ -702,6 +711,11 @@ found:
return
MMSYSERR_NOERROR
;
return
MMSYSERR_NOERROR
;
error:
error:
HeapFree
(
GetProcessHeap
(),
0
,
wim
);
HeapFree
(
GetProcessHeap
(),
0
,
wim
);
if
(
res
==
ACMERR_NOTPOSSIBLE
)
{
WARN
(
"ret = WAVERR_BADFORMAT
\n
"
);
return
WAVERR_BADFORMAT
;
}
WARN
(
"ret = MMSYSERR_ERROR
\n
"
);
return
MMSYSERR_ERROR
;
return
MMSYSERR_ERROR
;
}
}
...
...
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