Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
51dce3d1
Commit
51dce3d1
authored
Mar 22, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/alsa: simplify setup_format()
parent
c10f013f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
alsa_output_plugin.c
src/output/alsa_output_plugin.c
+4
-7
No files found.
src/output/alsa_output_plugin.c
View file @
51dce3d1
...
@@ -302,8 +302,6 @@ alsa_output_setup_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
...
@@ -302,8 +302,6 @@ alsa_output_setup_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
int
err
=
alsa_output_try_format
(
pcm
,
hwparams
,
audio_format
->
format
,
int
err
=
alsa_output_try_format
(
pcm
,
hwparams
,
audio_format
->
format
,
reverse_endian_r
);
reverse_endian_r
);
if
(
err
!=
-
EINVAL
)
return
err
;
/* if unsupported by the hardware, try other formats */
/* if unsupported by the hardware, try other formats */
...
@@ -316,7 +314,9 @@ alsa_output_setup_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
...
@@ -316,7 +314,9 @@ alsa_output_setup_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
SAMPLE_FORMAT_UNDEFINED
,
SAMPLE_FORMAT_UNDEFINED
,
};
};
for
(
unsigned
i
=
0
;
probe_formats
[
i
]
!=
SAMPLE_FORMAT_UNDEFINED
;
++
i
)
{
for
(
unsigned
i
=
0
;
err
==
-
EINVAL
&&
probe_formats
[
i
]
!=
SAMPLE_FORMAT_UNDEFINED
;
++
i
)
{
const
enum
sample_format
mpd_format
=
probe_formats
[
i
];
const
enum
sample_format
mpd_format
=
probe_formats
[
i
];
if
(
mpd_format
==
audio_format
->
format
)
if
(
mpd_format
==
audio_format
->
format
)
continue
;
continue
;
...
@@ -325,12 +325,9 @@ alsa_output_setup_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
...
@@ -325,12 +325,9 @@ alsa_output_setup_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
reverse_endian_r
);
reverse_endian_r
);
if
(
err
==
0
)
if
(
err
==
0
)
audio_format
->
format
=
mpd_format
;
audio_format
->
format
=
mpd_format
;
if
(
err
!=
-
EINVAL
)
return
err
;
}
}
return
-
EINVAL
;
return
err
;
}
}
/**
/**
...
...
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