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
dda7f979
Commit
dda7f979
authored
Jan 23, 2003
by
Waldeck Schutzer
Committed by
Alexandre Julliard
Jan 23, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Audio codecs were erroneously being listed multiple times, making it
difficult to run certain applications like VirtualDub.
parent
ab908c41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
29 deletions
+66
-29
format.c
dlls/msacm/format.c
+66
-29
No files found.
dlls/msacm/format.c
View file @
dda7f979
...
...
@@ -758,36 +758,73 @@ MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd,
if
(
paftd
->
cbStruct
<
sizeof
(
*
paftd
))
return
MMSYSERR_INVALPARAM
;
if
(
had
)
FIXME
(
"had != NULL, not supported
\n
"
);
/* (WS) MSDN info page says that if had != 0, then we should find
* the specific driver to get its tags from. Therefore I'm removing
* the FIXME call and adding a search block below. It also seems
* that the lack of this functionality was the responsible for
* codecs to be multiply and incorrectly listed.
*/
for
(
padid
=
MSACM_pFirstACMDriverID
;
padid
;
padid
=
padid
->
pNextACMDriverID
)
{
/* should check for codec only */
if
(
!
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_DISABLED
)
&&
acmDriverOpen
(
&
had
,
(
HACMDRIVERID
)
padid
,
0
)
==
MMSYSERR_NOERROR
)
{
for
(
i
=
0
;
i
<
padid
->
cFormatTags
;
i
++
)
{
paftd
->
dwFormatTagIndex
=
i
;
if
(
MSACM_Message
(
had
,
ACMDM_FORMATTAG_DETAILS
,
(
LPARAM
)
paftd
,
ACM_FORMATTAGDETAILSF_INDEX
)
==
MMSYSERR_NOERROR
)
{
if
(
paftd
->
dwFormatTag
==
WAVE_FORMAT_PCM
)
{
if
(
paftd
->
szFormatTag
[
0
]
==
0
)
MultiByteToWideChar
(
CP_ACP
,
0
,
"PCM"
,
-
1
,
paftd
->
szFormatTag
,
sizeof
(
paftd
->
szFormatTag
)
/
sizeof
(
WCHAR
)
);
/* FIXME (EPP): I'm not sure this is the correct
* algorithm (should make more sense to apply the same
* for all already loaded formats, but this will do
* for now
*/
if
(
bPcmDone
)
continue
;
bPcmDone
=
TRUE
;
}
if
(
!
(
fnCallback
)((
HACMDRIVERID
)
padid
,
paftd
,
dwInstance
,
padid
->
fdwSupport
))
{
acmDriverClose
(
had
,
0
);
return
MMSYSERR_NOERROR
;
}
}
}
}
acmDriverClose
(
had
,
0
);
/* if (had) FIXME("had != NULL, not supported\n"); */
if
(
had
)
{
if
(
acmDriverID
((
HACMOBJ
)
had
,
(
HACMDRIVERID
*
)
&
padid
,
0
)
!=
MMSYSERR_NOERROR
)
return
MMSYSERR_INVALHANDLE
;
for
(
i
=
0
;
i
<
padid
->
cFormatTags
;
i
++
)
{
paftd
->
dwFormatTagIndex
=
i
;
if
(
MSACM_Message
(
had
,
ACMDM_FORMATTAG_DETAILS
,
(
LPARAM
)
paftd
,
ACM_FORMATTAGDETAILSF_INDEX
)
==
MMSYSERR_NOERROR
)
{
if
(
paftd
->
dwFormatTag
==
WAVE_FORMAT_PCM
)
{
if
(
paftd
->
szFormatTag
[
0
]
==
0
)
MultiByteToWideChar
(
CP_ACP
,
0
,
"PCM"
,
-
1
,
paftd
->
szFormatTag
,
sizeof
(
paftd
->
szFormatTag
)
/
sizeof
(
WCHAR
)
);
/* (WS) I'm preserving this PCM hack since it seems to be
* correct. Please notice this block was borrowed from
* below.
*/
if
(
bPcmDone
)
continue
;
bPcmDone
=
TRUE
;
}
if
(
!
(
fnCallback
)((
HACMDRIVERID
)
padid
,
paftd
,
dwInstance
,
padid
->
fdwSupport
))
return
MMSYSERR_NOERROR
;
}
}
}
/* if had==0 then search for the first suitable driver */
else
{
for
(
padid
=
MSACM_pFirstACMDriverID
;
padid
;
padid
=
padid
->
pNextACMDriverID
)
{
/* should check for codec only */
if
(
!
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_DISABLED
)
&&
acmDriverOpen
(
&
had
,
(
HACMDRIVERID
)
padid
,
0
)
==
MMSYSERR_NOERROR
)
{
for
(
i
=
0
;
i
<
padid
->
cFormatTags
;
i
++
)
{
paftd
->
dwFormatTagIndex
=
i
;
if
(
MSACM_Message
(
had
,
ACMDM_FORMATTAG_DETAILS
,
(
LPARAM
)
paftd
,
ACM_FORMATTAGDETAILSF_INDEX
)
==
MMSYSERR_NOERROR
)
{
if
(
paftd
->
dwFormatTag
==
WAVE_FORMAT_PCM
)
{
if
(
paftd
->
szFormatTag
[
0
]
==
0
)
MultiByteToWideChar
(
CP_ACP
,
0
,
"PCM"
,
-
1
,
paftd
->
szFormatTag
,
sizeof
(
paftd
->
szFormatTag
)
/
sizeof
(
WCHAR
)
);
/* FIXME (EPP): I'm not sure this is the correct
* algorithm (should make more sense to apply the same
* for all already loaded formats, but this will do
* for now
*/
if
(
bPcmDone
)
continue
;
bPcmDone
=
TRUE
;
}
if
(
!
(
fnCallback
)((
HACMDRIVERID
)
padid
,
paftd
,
dwInstance
,
padid
->
fdwSupport
))
{
acmDriverClose
(
had
,
0
);
return
MMSYSERR_NOERROR
;
}
}
}
}
acmDriverClose
(
had
,
0
);
}
}
return
MMSYSERR_NOERROR
;
}
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