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
f03ae651
Commit
f03ae651
authored
Jul 25, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/audiorecord: Enumerate the currently set media type first.
parent
b0f7f843
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
audiorecord.c
dlls/qcap/audiorecord.c
+13
-7
audiorecord.c
dlls/qcap/tests/audiorecord.c
+2
-2
No files found.
dlls/qcap/audiorecord.c
View file @
f03ae651
...
...
@@ -114,13 +114,17 @@ audio_formats[] =
{
96000
,
16
,
1
},
};
static
HRESULT
fill_media_type
(
unsigned
int
index
,
AM_MEDIA_TYPE
*
mt
)
static
HRESULT
fill_media_type
(
struct
audio_record
*
filter
,
unsigned
int
index
,
AM_MEDIA_TYPE
*
mt
)
{
WAVEFORMATEX
*
format
;
if
(
index
>=
ARRAY_SIZE
(
audio_formats
))
if
(
index
>=
1
+
ARRAY_SIZE
(
audio_formats
))
return
VFW_S_NO_MORE_ITEMS
;
if
(
!
index
)
return
CopyMediaType
(
mt
,
&
filter
->
format
);
--
index
;
if
(
!
(
format
=
CoTaskMemAlloc
(
sizeof
(
*
format
))))
return
E_OUTOFMEMORY
;
...
...
@@ -147,7 +151,9 @@ static HRESULT fill_media_type(unsigned int index, AM_MEDIA_TYPE *mt)
static
HRESULT
audio_record_source_get_media_type
(
struct
strmbase_pin
*
iface
,
unsigned
int
index
,
AM_MEDIA_TYPE
*
mt
)
{
return
fill_media_type
(
index
,
mt
);
struct
audio_record
*
filter
=
impl_from_strmbase_filter
(
iface
->
filter
);
return
fill_media_type
(
filter
,
index
,
mt
);
}
static
HRESULT
WINAPI
audio_record_source_DecideBufferSize
(
struct
strmbase_source
*
iface
,
...
...
@@ -283,7 +289,7 @@ static HRESULT WINAPI stream_config_GetNumberOfCapabilities(IAMStreamConfig *ifa
TRACE
(
"filter %p, count %p, size %p.
\n
"
,
filter
,
count
,
size
);
*
count
=
ARRAY_SIZE
(
audio_formats
);
*
count
=
1
+
ARRAY_SIZE
(
audio_formats
);
*
size
=
sizeof
(
AUDIO_STREAM_CONFIG_CAPS
);
return
S_OK
;
}
...
...
@@ -298,13 +304,13 @@ static HRESULT WINAPI stream_config_GetStreamCaps(IAMStreamConfig *iface,
TRACE
(
"filter %p, index %d, ret_mt %p, caps %p.
\n
"
,
filter
,
index
,
ret_mt
,
caps
);
if
(
index
>=
ARRAY_SIZE
(
audio_formats
))
if
(
index
>=
1
+
ARRAY_SIZE
(
audio_formats
))
return
S_FALSE
;
if
(
!
(
mt
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
))))
return
E_OUTOFMEMORY
;
if
((
hr
=
fill_media_type
(
index
,
mt
))
!=
S_OK
)
if
((
hr
=
fill_media_type
(
filter
,
index
,
mt
))
!=
S_OK
)
{
CoTaskMemFree
(
mt
);
return
hr
;
...
...
@@ -795,7 +801,7 @@ HRESULT audio_record_create(IUnknown *outer, IUnknown **out)
return
E_OUTOFMEMORY
;
}
if
((
hr
=
fill_media_type
(
0
,
&
object
->
format
)))
if
((
hr
=
fill_media_type
(
object
,
1
,
&
object
->
format
)))
{
CloseHandle
(
object
->
event
);
free
(
object
);
...
...
dlls/qcap/tests/audiorecord.c
View file @
f03ae651
...
...
@@ -1122,13 +1122,13 @@ static void test_stream_config(IBaseFilter *filter)
IPin_EnumMediaTypes
(
source
,
&
enummt
);
hr
=
IEnumMediaTypes_Next
(
enummt
,
1
,
&
mt2
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine_if
(
i
>
0
)
ok
(
compare_media_types
(
mt
,
mt2
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
mt
,
mt2
),
"Media types didn't match.
\n
"
);
DeleteMediaType
(
mt2
);
IEnumMediaTypes_Release
(
enummt
);
hr
=
IAMStreamConfig_GetStreamCaps
(
config
,
0
,
&
mt2
,
(
BYTE
*
)
&
caps
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine_if
(
i
>
0
)
ok
(
compare_media_types
(
mt
,
mt2
),
"Media types didn't match.
\n
"
);
ok
(
compare_media_types
(
mt
,
mt2
),
"Media types didn't match.
\n
"
);
DeleteMediaType
(
mt2
);
DeleteMediaType
(
mt
);
...
...
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