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
dfeafc74
Commit
dfeafc74
authored
Feb 09, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Handle MPEG-1 audio formats in amt_to_wg_format().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d73df9e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
gstdemux.c
dlls/winegstreamer/gstdemux.c
+57
-0
No files found.
dlls/winegstreamer/gstdemux.c
View file @
dfeafc74
...
...
@@ -686,6 +686,57 @@ static bool amt_to_wg_format_audio(const AM_MEDIA_TYPE *mt, struct wg_format *fo
return
false
;
}
static
bool
amt_to_wg_format_audio_mpeg1
(
const
AM_MEDIA_TYPE
*
mt
,
struct
wg_format
*
format
)
{
const
MPEG1WAVEFORMAT
*
audio_format
=
(
const
MPEG1WAVEFORMAT
*
)
mt
->
pbFormat
;
if
(
!
IsEqualGUID
(
&
mt
->
formattype
,
&
FORMAT_WaveFormatEx
))
{
FIXME
(
"Unknown format type %s.
\n
"
,
debugstr_guid
(
&
mt
->
formattype
));
return
false
;
}
if
(
mt
->
cbFormat
<
sizeof
(
*
audio_format
)
||
!
mt
->
pbFormat
)
{
ERR
(
"Unexpected format size %u.
\n
"
,
mt
->
cbFormat
);
return
false
;
}
format
->
major_type
=
WG_MAJOR_TYPE_AUDIO
;
format
->
u
.
audio
.
channels
=
audio_format
->
wfx
.
nChannels
;
format
->
u
.
audio
.
rate
=
audio_format
->
wfx
.
nSamplesPerSec
;
if
(
audio_format
->
fwHeadLayer
==
1
)
format
->
u
.
audio
.
format
=
WG_AUDIO_FORMAT_MPEG1_LAYER1
;
else
if
(
audio_format
->
fwHeadLayer
==
2
)
format
->
u
.
audio
.
format
=
WG_AUDIO_FORMAT_MPEG1_LAYER2
;
else
if
(
audio_format
->
fwHeadLayer
==
3
)
format
->
u
.
audio
.
format
=
WG_AUDIO_FORMAT_MPEG1_LAYER3
;
else
return
false
;
return
true
;
}
static
bool
amt_to_wg_format_audio_mpeg1_layer3
(
const
AM_MEDIA_TYPE
*
mt
,
struct
wg_format
*
format
)
{
const
MPEGLAYER3WAVEFORMAT
*
audio_format
=
(
const
MPEGLAYER3WAVEFORMAT
*
)
mt
->
pbFormat
;
if
(
!
IsEqualGUID
(
&
mt
->
formattype
,
&
FORMAT_WaveFormatEx
))
{
FIXME
(
"Unknown format type %s.
\n
"
,
debugstr_guid
(
&
mt
->
formattype
));
return
false
;
}
if
(
mt
->
cbFormat
<
sizeof
(
*
audio_format
)
||
!
mt
->
pbFormat
)
{
ERR
(
"Unexpected format size %u.
\n
"
,
mt
->
cbFormat
);
return
false
;
}
format
->
major_type
=
WG_MAJOR_TYPE_AUDIO
;
format
->
u
.
audio
.
channels
=
audio_format
->
wfx
.
nChannels
;
format
->
u
.
audio
.
rate
=
audio_format
->
wfx
.
nSamplesPerSec
;
format
->
u
.
audio
.
format
=
WG_AUDIO_FORMAT_MPEG1_LAYER3
;
return
true
;
}
static
bool
amt_to_wg_format_video
(
const
AM_MEDIA_TYPE
*
mt
,
struct
wg_format
*
format
)
{
static
const
struct
...
...
@@ -750,7 +801,13 @@ static bool amt_to_wg_format(const AM_MEDIA_TYPE *mt, struct wg_format *format)
if
(
IsEqualGUID
(
&
mt
->
majortype
,
&
MEDIATYPE_Video
))
return
amt_to_wg_format_video
(
mt
,
format
);
if
(
IsEqualGUID
(
&
mt
->
majortype
,
&
MEDIATYPE_Audio
))
{
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_MPEG1AudioPayload
))
return
amt_to_wg_format_audio_mpeg1
(
mt
,
format
);
if
(
IsEqualGUID
(
&
mt
->
subtype
,
&
MEDIASUBTYPE_MP3
))
return
amt_to_wg_format_audio_mpeg1_layer3
(
mt
,
format
);
return
amt_to_wg_format_audio
(
mt
,
format
);
}
FIXME
(
"Unknown major type %s.
\n
"
,
debugstr_guid
(
&
mt
->
majortype
));
return
false
;
...
...
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