diff options
author | Max Kellermann <max@duempel.org> | 2009-12-25 14:27:32 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-25 17:29:41 +0100 |
commit | b54bde6f2b9f826cd7189182d733aada66c95dd8 (patch) | |
tree | f07f7b57f0d83879e6aa35ba3bbdaa06b4cbf4f1 /src/filter/convert_filter_plugin.c | |
parent | d2051c7f50deff0532566c070aaf4fec5d774558 (diff) | |
download | mpd-b54bde6f2b9f826cd7189182d733aada66c95dd8.tar.gz mpd-b54bde6f2b9f826cd7189182d733aada66c95dd8.tar.xz mpd-b54bde6f2b9f826cd7189182d733aada66c95dd8.zip |
filter_plugin: allow open() to force an input format
Make the audio_format argument non-const. Allow the open() method to
modify it, to indicate that it wants a different input audio format
than the one specified. Check that condition in chain_filter_open(),
and fail.
Diffstat (limited to '')
-rw-r--r-- | src/filter/convert_filter_plugin.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/filter/convert_filter_plugin.c b/src/filter/convert_filter_plugin.c index 982ec7c4c..87070fa3a 100644 --- a/src/filter/convert_filter_plugin.c +++ b/src/filter/convert_filter_plugin.c @@ -71,8 +71,7 @@ convert_filter_finish(struct filter *filter) } static const struct audio_format * -convert_filter_open(struct filter *_filter, - const struct audio_format *audio_format, +convert_filter_open(struct filter *_filter, struct audio_format *audio_format, G_GNUC_UNUSED GError **error_r) { struct convert_filter *filter = (struct convert_filter *)_filter; @@ -82,7 +81,7 @@ convert_filter_open(struct filter *_filter, filter->in_audio_format = filter->out_audio_format = *audio_format; pcm_convert_init(&filter->state); - return audio_format; + return &filter->in_audio_format; } static void |