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
2a321ce3
Commit
2a321ce3
authored
Aug 22, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Leave WM reader CS on invalid output format.
parent
31aa91c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
wm_reader.c
dlls/winegstreamer/wm_reader.c
+20
-15
No files found.
dlls/winegstreamer/wm_reader.c
View file @
2a321ce3
...
...
@@ -1764,6 +1764,7 @@ HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
struct
output_props
*
props
=
unsafe_impl_from_IWMOutputMediaProps
(
props_iface
);
struct
wg_format
format
,
pref_format
;
struct
wm_stream
*
stream
;
HRESULT
hr
=
S_OK
;
int
i
;
strmbase_dump_media_type
(
&
props
->
mt
);
...
...
@@ -1786,18 +1787,15 @@ HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
if
(
pref_format
.
major_type
!=
format
.
major_type
)
{
/* R.U.S.E sets the type of the wrong stream, apparently by accident. */
LeaveCriticalSection
(
&
reader
->
cs
);
WARN
(
"Major types don't match; returning NS_E_INCOMPATIBLE_FORMAT.
\n
"
);
return
NS_E_INCOMPATIBLE_FORMAT
;
hr
=
NS_E_INCOMPATIBLE_FORMAT
;
}
switch
(
pref_format
.
major_type
)
else
switch
(
pref_format
.
major_type
)
{
case
WG_MAJOR_TYPE_AUDIO
:
if
(
format
.
u
.
audio
.
format
==
WG_AUDIO_FORMAT_UNKNOWN
)
return
NS_E_AUDIO_CODEC_NOT_INSTALLED
;
if
(
format
.
u
.
audio
.
channels
>
pref_format
.
u
.
audio
.
channels
)
return
NS_E_AUDIO_CODEC_NOT_INSTALLED
;
hr
=
NS_E_AUDIO_CODEC_NOT_INSTALLED
;
else
if
(
format
.
u
.
audio
.
channels
>
pref_format
.
u
.
audio
.
channels
)
hr
=
NS_E_AUDIO_CODEC_NOT_INSTALLED
;
break
;
case
WG_MAJOR_TYPE_VIDEO
:
...
...
@@ -1805,16 +1803,23 @@ HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
if
(
format
.
u
.
video
.
format
==
video_formats
[
i
])
break
;
if
(
i
==
ARRAY_SIZE
(
video_formats
))
return
NS_E_INVALID_OUTPUT_FORMAT
;
if
(
pref_format
.
u
.
video
.
width
!=
format
.
u
.
video
.
width
)
return
NS_E_INVALID_OUTPUT_FORMAT
;
if
(
pref_format
.
u
.
video
.
height
!=
format
.
u
.
video
.
height
)
return
NS_E_INVALID_OUTPUT_FORMAT
;
hr
=
NS_E_INVALID_OUTPUT_FORMAT
;
else
if
(
pref_format
.
u
.
video
.
width
!=
format
.
u
.
video
.
width
)
hr
=
NS_E_INVALID_OUTPUT_FORMAT
;
else
if
(
pref_format
.
u
.
video
.
height
!=
format
.
u
.
video
.
height
)
hr
=
NS_E_INVALID_OUTPUT_FORMAT
;
break
;
default:
return
NS_E_INCOMPATIBLE_FORMAT
;
hr
=
NS_E_INCOMPATIBLE_FORMAT
;
break
;
}
if
(
FAILED
(
hr
))
{
WARN
(
"Unsupported media type, returning %#lx.
\n
"
,
hr
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
hr
;
}
stream
->
format
=
format
;
...
...
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