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
8c8cf089
Commit
8c8cf089
authored
Jul 04, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use a wg_audio_format switch rather than array indexes.
parent
2a9af6ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
22 deletions
+36
-22
quartz_parser.c
dlls/winegstreamer/quartz_parser.c
+36
-22
No files found.
dlls/winegstreamer/quartz_parser.c
View file @
8c8cf089
...
...
@@ -101,6 +101,40 @@ static HRESULT WINAPI GST_ChangeCurrent(IMediaSeeking *iface);
static
HRESULT
WINAPI
GST_ChangeStop
(
IMediaSeeking
*
iface
);
static
HRESULT
WINAPI
GST_ChangeRate
(
IMediaSeeking
*
iface
);
static
bool
wg_audio_format_is_float
(
enum
wg_audio_format
format
)
{
switch
(
format
)
{
case
WG_AUDIO_FORMAT_UNKNOWN
:
return
false
;
case
WG_AUDIO_FORMAT_U8
:
return
false
;
case
WG_AUDIO_FORMAT_S16LE
:
return
false
;
case
WG_AUDIO_FORMAT_S24LE
:
return
false
;
case
WG_AUDIO_FORMAT_S32LE
:
return
false
;
case
WG_AUDIO_FORMAT_F32LE
:
return
true
;
case
WG_AUDIO_FORMAT_F64LE
:
return
true
;
}
assert
(
0
);
return
false
;
}
static
WORD
wg_audio_format_get_depth
(
enum
wg_audio_format
format
)
{
switch
(
format
)
{
case
WG_AUDIO_FORMAT_UNKNOWN
:
return
0
;
case
WG_AUDIO_FORMAT_U8
:
return
8
;
case
WG_AUDIO_FORMAT_S16LE
:
return
16
;
case
WG_AUDIO_FORMAT_S24LE
:
return
24
;
case
WG_AUDIO_FORMAT_S32LE
:
return
32
;
case
WG_AUDIO_FORMAT_F32LE
:
return
32
;
case
WG_AUDIO_FORMAT_F64LE
:
return
64
;
}
assert
(
0
);
return
0
;
}
static
bool
amt_from_wg_format_audio
(
AM_MEDIA_TYPE
*
mt
,
const
struct
wg_format
*
format
)
{
mt
->
majortype
=
MEDIATYPE_Audio
;
...
...
@@ -118,28 +152,8 @@ static bool amt_from_wg_format_audio(AM_MEDIA_TYPE *mt, const struct wg_format *
case
WG_AUDIO_FORMAT_F32LE
:
case
WG_AUDIO_FORMAT_F64LE
:
{
static
const
struct
{
bool
is_float
;
WORD
depth
;
}
format_table
[]
=
{
{
0
},
{
false
,
8
},
{
false
,
16
},
{
false
,
24
},
{
false
,
32
},
{
true
,
32
},
{
true
,
64
},
};
bool
is_float
;
WORD
depth
;
assert
(
format
->
u
.
audio
.
format
<
ARRAY_SIZE
(
format_table
));
is_float
=
format_table
[
format
->
u
.
audio
.
format
].
is_float
;
depth
=
format_table
[
format
->
u
.
audio
.
format
].
depth
;
bool
is_float
=
wg_audio_format_is_float
(
format
->
u
.
audio
.
format
);
WORD
depth
=
wg_audio_format_get_depth
(
format
->
u
.
audio
.
format
);
if
(
is_float
||
format
->
u
.
audio
.
channels
>
2
)
{
...
...
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