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
afe7bc06
Commit
afe7bc06
authored
Jan 04, 2012
by
Jörg Höhle
Committed by
Alexandre Julliard
Jan 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Ignore broken nBlockAlign and AvgBytes within PCMWAVEFORMAT.
parent
bcc65899
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
waveform.c
dlls/winmm/waveform.c
+15
-2
No files found.
dlls/winmm/waveform.c
View file @
afe7bc06
...
...
@@ -843,6 +843,19 @@ static LRESULT WINMM_OpenDevice(WINMM_Device *device, WINMM_MMDevice *mmdevice,
passed_fmt
=
&
fmt
;
memcpy
(
passed_fmt
,
info
->
format
,
sizeof
(
PCMWAVEFORMAT
));
passed_fmt
->
cbSize
=
0
;
if
(
fmt
.
wBitsPerSample
%
8
!=
0
){
WARN
(
"Fixing bad wBitsPerSample (%u)
\n
"
,
fmt
.
wBitsPerSample
);
fmt
.
wBitsPerSample
=
(
fmt
.
wBitsPerSample
+
7
)
&
~
7
;
}
/* winmm ignores broken blockalign and avgbytes */
if
(
fmt
.
nBlockAlign
!=
fmt
.
nChannels
*
fmt
.
wBitsPerSample
/
8
){
WARN
(
"Fixing bad nBlockAlign (%u)
\n
"
,
fmt
.
nBlockAlign
);
fmt
.
nBlockAlign
=
fmt
.
nChannels
*
fmt
.
wBitsPerSample
/
8
;
}
if
(
fmt
.
nAvgBytesPerSec
!=
fmt
.
nSamplesPerSec
*
fmt
.
nBlockAlign
)
{
WARN
(
"Fixing bad nAvgBytesPerSec (%u)
\n
"
,
fmt
.
nAvgBytesPerSec
);
fmt
.
nAvgBytesPerSec
=
fmt
.
nSamplesPerSec
*
fmt
.
nBlockAlign
;
}
}
else
passed_fmt
=
info
->
format
;
...
...
@@ -909,8 +922,8 @@ static LRESULT WINMM_OpenDevice(WINMM_Device *device, WINMM_MMDevice *mmdevice,
goto
error
;
}
device
->
bytes_per_frame
=
info
->
forma
t
->
nBlockAlign
;
device
->
samples_per_sec
=
info
->
forma
t
->
nSamplesPerSec
;
device
->
bytes_per_frame
=
passed_fm
t
->
nBlockAlign
;
device
->
samples_per_sec
=
passed_fm
t
->
nSamplesPerSec
;
device
->
played_frames
=
0
;
device
->
last_clock_pos
=
0
;
...
...
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