Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
8f2afb98
Commit
8f2afb98
authored
Dec 09, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: remove a few useless variables
Overwriting *fmt is safe nowadays.
parent
345a3e31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+9
-15
No files found.
modules/audio_output/alsa.c
View file @
8f2afb98
...
...
@@ -318,10 +318,9 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
return
VLC_ENOMEM
;
snd_pcm_format_t
pcm_format
;
/* ALSA sample format */
vlc_fourcc_t
fourcc
=
fmt
->
i_format
;
bool
spdif
=
false
;
switch
(
f
ourcc
)
switch
(
f
mt
->
i_format
)
{
case
VLC_CODEC_F64B
:
pcm_format
=
SND_PCM_FORMAT_FLOAT64_BE
;
...
...
@@ -376,18 +375,18 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
spdif
=
var_InheritBool
(
aout
,
"spdif"
);
if
(
spdif
)
{
f
ourcc
=
VLC_CODEC_SPDIFL
;
f
mt
->
i_format
=
VLC_CODEC_SPDIFL
;
pcm_format
=
SND_PCM_FORMAT_S16
;
}
else
if
(
HAVE_FPU
)
{
f
ourcc
=
VLC_CODEC_FL32
;
f
mt
->
i_format
=
VLC_CODEC_FL32
;
pcm_format
=
SND_PCM_FORMAT_FLOAT
;
}
else
{
f
ourcc
=
VLC_CODEC_S16N
;
f
mt
->
i_format
=
VLC_CODEC_S16N
;
pcm_format
=
SND_PCM_FORMAT_S16
;
}
}
...
...
@@ -473,19 +472,19 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
else
if
(
snd_pcm_hw_params_test_format
(
pcm
,
hw
,
SND_PCM_FORMAT_FLOAT
)
==
0
)
{
f
ourcc
=
VLC_CODEC_FL32
;
f
mt
->
i_format
=
VLC_CODEC_FL32
;
pcm_format
=
SND_PCM_FORMAT_FLOAT
;
}
else
if
(
snd_pcm_hw_params_test_format
(
pcm
,
hw
,
SND_PCM_FORMAT_S32
)
==
0
)
{
f
ourcc
=
VLC_CODEC_S32N
;
f
mt
->
i_format
=
VLC_CODEC_S32N
;
pcm_format
=
SND_PCM_FORMAT_S32
;
}
else
if
(
snd_pcm_hw_params_test_format
(
pcm
,
hw
,
SND_PCM_FORMAT_S16
)
==
0
)
{
f
ourcc
=
VLC_CODEC_S16N
;
f
mt
->
i_format
=
VLC_CODEC_S16N
;
pcm_format
=
SND_PCM_FORMAT_S16
;
}
else
...
...
@@ -526,15 +525,13 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
}
/* Set sample rate */
unsigned
rate
=
fmt
->
i_rate
;
val
=
snd_pcm_hw_params_set_rate_near
(
pcm
,
hw
,
&
rate
,
NULL
);
val
=
snd_pcm_hw_params_set_rate_near
(
pcm
,
hw
,
&
fmt
->
i_rate
,
NULL
);
if
(
val
)
{
msg_Err
(
aout
,
"cannot set sample rate: %s"
,
snd_strerror
(
val
));
goto
error
;
}
if
(
fmt
->
i_rate
!=
rate
)
msg_Dbg
(
aout
,
"resampling from %d Hz to %d Hz"
,
fmt
->
i_rate
,
rate
);
sys
->
rate
=
fmt
->
i_rate
;
/* Set buffer size */
param
=
AOUT_MAX_ADVANCE_TIME
;
...
...
@@ -610,9 +607,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
}
/* Setup audio_output_t */
fmt
->
i_format
=
fourcc
;
fmt
->
i_rate
=
rate
;
sys
->
rate
=
rate
;
if
(
spdif
)
{
fmt
->
i_bytes_per_frame
=
AOUT_SPDIF_SIZE
;
...
...
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