Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
138f098d
Commit
138f098d
authored
May 14, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used vlc_fourcc_GetCodecAudio when applicable.
parent
4de16278
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
144 deletions
+20
-144
modules/codec/araw.c
modules/codec/araw.c
+11
-80
modules/packetizer/copy.c
modules/packetizer/copy.c
+9
-64
No files found.
modules/codec/araw.c
View file @
138f098d
...
...
@@ -266,85 +266,6 @@ static int DecoderOpen( vlc_object_t *p_this )
p_dec
->
fmt_out
.
i_codec
=
p_dec
->
fmt_in
.
i_codec
;
p_dec
->
fmt_in
.
audio
.
i_bitspersample
=
8
;
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
'a'
,
'f'
,
'l'
,
't'
)
)
{
switch
(
(
p_dec
->
fmt_in
.
audio
.
i_bitspersample
+
7
)
/
8
)
{
case
4
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_FL32
;
break
;
case
8
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_FL64
;
break
;
default:
msg_Err
(
p_dec
,
"bad parameters(bits/sample)"
);
return
VLC_EGENERIC
;
}
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
'a'
,
'r'
,
'a'
,
'w'
)
||
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
'p'
,
'c'
,
'm'
,
' '
)
)
{
switch
(
(
p_dec
->
fmt_in
.
audio
.
i_bitspersample
+
7
)
/
8
)
{
case
1
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_U8
;
break
;
case
2
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16L
;
break
;
case
3
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S24L
;
break
;
case
4
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32L
;
break
;
default:
msg_Err
(
p_dec
,
"bad parameters(bits/sample)"
);
return
VLC_EGENERIC
;
}
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
't'
,
'w'
,
'o'
,
's'
)
)
{
switch
(
(
p_dec
->
fmt_in
.
audio
.
i_bitspersample
+
7
)
/
8
)
{
case
1
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S8
;
break
;
case
2
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16B
;
break
;
case
3
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S24B
;
break
;
case
4
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32B
;
break
;
default:
msg_Err
(
p_dec
,
"bad parameters(bits/sample)"
);
return
VLC_EGENERIC
;
}
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
's'
,
'o'
,
'w'
,
't'
)
)
{
switch
(
(
p_dec
->
fmt_in
.
audio
.
i_bitspersample
+
7
)
/
8
)
{
case
1
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S8
;
break
;
case
2
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16L
;
break
;
case
3
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S24L
;
break
;
case
4
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32L
;
break
;
default:
msg_Err
(
p_dec
,
"bad parameters(bits/sample)"
);
return
VLC_EGENERIC
;
}
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_ALAW
)
{
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16N
;
...
...
@@ -357,7 +278,17 @@ static int DecoderOpen( vlc_object_t *p_this )
p_sys
->
p_logtos16
=
ulawtos16
;
p_dec
->
fmt_in
.
audio
.
i_bitspersample
=
8
;
}
else
return
VLC_EGENERIC
;
else
{
p_dec
->
fmt_out
.
i_codec
=
vlc_fourcc_GetCodecAudio
(
p_dec
->
fmt_in
.
i_codec
,
p_dec
->
fmt_in
.
audio
.
i_bitspersample
);
if
(
!
p_dec
->
fmt_out
.
i_codec
)
{
msg_Err
(
p_dec
,
"bad parameters(bits/sample)"
);
return
VLC_EGENERIC
;
}
}
/* Set output properties */
p_dec
->
fmt_out
.
i_cat
=
AUDIO_ES
;
...
...
modules/packetizer/copy.c
View file @
138f098d
...
...
@@ -87,71 +87,16 @@ static int Open( vlc_object_t *p_this )
/* Create the output format */
es_format_Copy
(
&
p_dec
->
fmt_out
,
&
p_dec
->
fmt_in
);
/* Fix the value of the fourcc */
switch
(
p_dec
->
fmt_in
.
i_codec
)
/* Fix the value of the fourcc
for audio
*/
if
(
p_dec
->
fmt_in
.
i_cat
==
AUDIO_ES
)
{
case
VLC_FOURCC
(
'a'
,
'r'
,
'a'
,
'w'
):
switch
(
(
p_dec
->
fmt_in
.
audio
.
i_bitspersample
+
7
)
/
8
)
{
case
1
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_U8
;
break
;
case
2
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16L
;
break
;
case
3
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S24L
;
break
;
case
4
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32L
;
break
;
default:
msg_Err
(
p_dec
,
"unknown raw audio sample size"
);
return
VLC_EGENERIC
;
}
break
;
case
VLC_FOURCC
(
't'
,
'w'
,
'o'
,
's'
):
switch
(
(
p_dec
->
fmt_in
.
audio
.
i_bitspersample
+
7
)
/
8
)
{
case
1
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S8
;
break
;
case
2
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16B
;
break
;
case
3
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S24B
;
break
;
case
4
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32B
;
break
;
default:
msg_Err
(
p_dec
,
"unknown raw audio sample size"
);
return
VLC_EGENERIC
;
}
break
;
case
VLC_FOURCC
(
's'
,
'o'
,
'w'
,
't'
):
switch
(
(
p_dec
->
fmt_in
.
audio
.
i_bitspersample
+
7
)
/
8
)
{
case
1
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S8
;
break
;
case
2
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16L
;
break
;
case
3
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S24L
;
break
;
case
4
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32L
;
break
;
default:
msg_Err
(
p_dec
,
"unknown raw audio sample size"
);
return
VLC_EGENERIC
;
}
break
;
p_dec
->
fmt_out
.
i_codec
=
vlc_fourcc_GetCodecAudio
(
p_dec
->
fmt_in
.
i_codec
,
p_dec
->
fmt_in
.
audio
.
i_bitspersample
);
if
(
!
p_dec
->
fmt_out
.
i_codec
)
{
msg_Err
(
p_dec
,
"unknown raw audio sample size"
);
return
VLC_EGENERIC
;
}
}
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
...
...
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