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
bd29f7e3
Commit
bd29f7e3
authored
Dec 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter/route: check configured channel count in method init()
Detect misconfiguration during MPD startup, not when playback begins.
parent
c3bb81ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
route_filter_plugin.c
src/filter/route_filter_plugin.c
+9
-8
No files found.
src/filter/route_filter_plugin.c
View file @
bd29f7e3
...
...
@@ -178,6 +178,14 @@ route_filter_parse(const struct config_param *param,
g_strfreev
(
sd
);
}
if
(
!
audio_valid_channel_count
(
filter
->
min_output_channels
))
{
g_strfreev
(
tokens
);
g_set_error
(
error_r
,
audio_format_quark
(),
0
,
"Invalid number of output channels requested: %d"
,
filter
->
min_output_channels
);
return
false
;
}
// Allocate a map of "copy nothing to me"
filter
->
sources
=
g_malloc
(
filter
->
min_output_channels
*
sizeof
(
signed
char
));
...
...
@@ -242,7 +250,7 @@ route_filter_finish(struct filter *_filter)
static
const
struct
audio_format
*
route_filter_open
(
struct
filter
*
_filter
,
const
struct
audio_format
*
audio_format
,
GError
**
error_r
)
G_GNUC_UNUSED
GError
**
error_r
)
{
struct
route_filter
*
filter
=
(
struct
route_filter
*
)
_filter
;
...
...
@@ -251,13 +259,6 @@ route_filter_open(struct filter *_filter,
filter
->
input_frame_size
=
audio_format_frame_size
(
&
filter
->
input_format
);
if
(
!
audio_valid_channel_count
(
filter
->
min_output_channels
))
{
g_set_error
(
error_r
,
audio_format_quark
(),
2
,
"Invalid number of output channels requested: %d"
,
filter
->
min_output_channels
);
return
NULL
;
}
// Decide on an output format which has enough channels,
// and is otherwise identical
filter
->
output_format
=
*
audio_format
;
...
...
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